We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b42ff43 commit 36901ccCopy full SHA for 36901cc
1 file changed
blog/26-05-17/almostnode/ex/ex2.html
@@ -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