Comparing version 0.1.3 to 0.1.4
@@ -7,4 +7,5 @@ export interface DuktapeExport { | ||
message: (msg: string) => void; | ||
reset: (init?: string) => void; | ||
} | ||
export declare const uuid: () => string; | ||
export declare const DuktapeVM: (init?: string) => Promise<DuktapeExport>; |
@@ -9,2 +9,4 @@ const DuktapeVM = require("./duktape-vm").DuktapeVM; | ||
console.log(vm.eval("return args[0] + args[1]", [2, 3])); | ||
vm.reset(); | ||
console.log(vm.eval("return args[0] + args[1]", [2, 3])); | ||
}); |
{ | ||
"name": "duktape-vm", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"description": "Javascript VM running in WebAssembly", | ||
@@ -14,3 +14,3 @@ "main": "build/ducktape-vm.js", | ||
}, | ||
"typings":"build/index.d.ts", | ||
"typings": "build/index.d.ts", | ||
"keywords": [ | ||
@@ -17,0 +17,0 @@ "vm", |
@@ -5,3 +5,3 @@ # Duktape Javascript Virtual Machine | ||
This project is a thin wrapper around the [Duktape Embedded Javascript Engine](https://duktape.org/) compiled to webassembly/asmjs. | ||
This project is a wrapper around the [Duktape Embedded Javascript Engine](https://duktape.org/) compiled to webassembly/asmjs. | ||
@@ -26,11 +26,7 @@ - Airtight sandbox for unsafe js code. | ||
setTimeout(function() { | ||
_success("hello, " + args[0]); | ||
_success("hello, world!"); | ||
}, 1000);`, | ||
["world!"] | ||
).then((res) => { | ||
console.log(res) // hello, world! | ||
}) | ||
// destroy vm | ||
vm.destroy(); | ||
}); | ||
@@ -63,9 +59,9 @@ ``` | ||
<!-- Webassembly Only Version (Fast with 75% browser support), 110KB --> | ||
<script src="https://cdn.jsdelivr.net/npm/duktape-vm@0.1.3/build/duktape-vm.min.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/duktape-vm@0.1.4/build/duktape-vm.min.js"></script> | ||
<!-- AsmJS Only Version (Slower with 95% browser support), 115KB --> | ||
<script src="https://cdn.jsdelivr.net/npm/duktape-vm@0.1.3/build/duktape-vm.min.asm.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/duktape-vm@0.1.4/build/duktape-vm.min.asm.js"></script> | ||
<!-- Webassembly with AsmJS fallback (Fast with 95% browser support), 220KB --> | ||
<script src="https://cdn.jsdelivr.net/npm/duktape-vm@0.1.3/build/duktape-vm.min.both.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/duktape-vm@0.1.4/build/duktape-vm.min.both.js"></script> | ||
``` | ||
@@ -147,2 +143,6 @@ | ||
// reload vm | ||
// dumps the stack, makes a new one, then runs the init code again | ||
vm.reset(); | ||
// destroy vm | ||
@@ -149,0 +149,0 @@ vm.destroy(); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
2496396
2594