Comparing version 0.0.2 to 0.0.3
export interface DuktapeExport { | ||
destroy: () => void; | ||
eval: (js: string, safe?: boolean) => string; | ||
eval: (js: string) => string; | ||
onMessage: (callback: (msg: string) => void) => void; | ||
@@ -5,0 +5,0 @@ message: (msg: string) => void; |
{ | ||
"name": "duktape-vm", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "Javascript VM running in WebAssembly", | ||
@@ -5,0 +5,0 @@ "main": "build/ducktape-vm.js", |
@@ -13,3 +13,3 @@ # Duktape Javascript Virtual Machine | ||
- Supports bidirectional messaging. | ||
- Only 140KB gzipped. | ||
- Only 110KB gzipped. | ||
@@ -30,6 +30,8 @@ ## 2 minute example | ||
// print to parent console | ||
vm_breakout("console.log(" + message + ");") | ||
vm_breakout("console.log('" + message + "');") | ||
}; | ||
exports.someObj = ${JSON.stringify(obj)}; | ||
// you can also inline js libraries here | ||
`); | ||
@@ -41,2 +43,3 @@ | ||
// Messaging API | ||
vm.eval(` | ||
@@ -85,10 +88,10 @@ exports.onMessage(function(msg) { | ||
```html | ||
<!-- Webassembly Only Version (Fast with 75% browser support), 140KB --> | ||
<script src="https://cdn.jsdelivr.net/npm/duktape-vm@0.0.2/build/duktape-vm.min.js"></script> | ||
<!-- Webassembly Only Version (Fast with 75% browser support), 110KB --> | ||
<script src="https://cdn.jsdelivr.net/npm/duktape-vm@0.0.3/build/duktape-vm.min.js"></script> | ||
<!-- AsmJS Only Version (Slower with 95% browser support), 150KB --> | ||
<script src="https://cdn.jsdelivr.net/npm/duktape-vm@0.0.2/build/duktape-vm.min.asm.js"></script> | ||
<!-- AsmJS Only Version (Slower with 95% browser support), 115KB --> | ||
<script src="https://cdn.jsdelivr.net/npm/duktape-vm@0.0.3/build/duktape-vm.min.asm.js"></script> | ||
<!-- Webassembly AND AsmJS Version (Fast with 95% browser support), 280KB --> | ||
<script src="https://cdn.jsdelivr.net/npm/duktape-vm@0.0.2/build/duktape-vm.min.both.js"></script> | ||
<!-- Webassembly AND AsmJS Version (Fast with 95% browser support), 220KB --> | ||
<script src="https://cdn.jsdelivr.net/npm/duktape-vm@0.0.3/build/duktape-vm.min.both.js"></script> | ||
``` | ||
@@ -95,0 +98,0 @@ |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
115
2449180
8
2345
9