Skip to content

Commit 36901cc

Browse files
Create ex2.html
1 parent b42ff43 commit 36901cc

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<h3>test</h3>
2+
3+
<script type=module>
4+
5+
6+
7+
import { createContainer } from 'https://cdn.jsdelivr.net/npm/almostnode/+esm';
8+
9+
const { vfs, runtime, npm } = createContainer();
10+
11+
// Write a file to the virtual filesystem
12+
vfs.writeFileSync('/hello.js', `
13+
console.log('Hello from almostnode!');
14+
`);
15+
16+
// Execute it
17+
var result = runtime.runFile('/hello.js');
18+
19+
console.log(result);
20+
21+
console.log('done');
22+
23+
</script>
24+
25+
26+
27+
28+

0 commit comments

Comments
 (0)