@bytecodealliance/jco
Advanced tools
Comparing version 0.4.2 to 0.5.0
{ | ||
"name": "@bytecodealliance/jco", | ||
"description": "JavaScript tooling for working with WebAssembly Components", | ||
"version": "0.4.2", | ||
"version": "0.5.0", | ||
"exports": "./api.mjs", | ||
@@ -6,0 +6,0 @@ "types": "api.d.ts", |
@@ -21,6 +21,6 @@ <div align="center"> | ||
* Creating WebAssembly Components from JavaScript sources and a WIT world | ||
* "Transpiling" Wasm Component binaries into ES modules that can run in any JS environment. | ||
* Optimization helpers for Components via Binaryen. | ||
* Component builds of [Wasm Tools](https://github.com/bytecodealliance/wasm-tools) helpers, available for use as a library or CLI commands for use in native JS environments. | ||
* "Componentize" for WebAssembly Components from JavaScript sources and a WIT world | ||
@@ -69,12 +69,20 @@ For creating components in other languages, see the [Cargo Component](https://github.com/bytecodealliance/cargo-Component) project for Rust and [Wit Bindgen](https://github.com/bytecodealliance/wit-bindgen) for various guest bindgen helpers. | ||
## API | ||
### Componentize | ||
The below is an outline of the available API functions, see [api.d.ts](api.d.ts) file for the exact options. | ||
To componentize a JS file run: | ||
#### `componentize(jsSource: String, witWorld: String, opts?): Promise<{ component: Uint8Array }>` | ||
``` | ||
jco componentize app.js --world world.wit -o component.wasm | ||
``` | ||
Creates a component from a JS file and WIT world definition, via a Spidermonkey engine embedding. | ||
Creates a component from a JS module implementing a WIT world definition, via a Spidermonkey engine embedding. | ||
Currently requires an explicit install of the componentize-js engine via `npm install @bytecodealliance/componentize-js`. | ||
See [ComponentizeJS](https://github.com/bytecodealliance/componentize-js) for more details on this process. | ||
> Additional engines may be supported in future via an `--engine` field or otherwise. | ||
## API | ||
#### `transpile(component: Uint8Array, opts?): Promise<{ files: Record<string, Uint8Array> }>` | ||
@@ -81,0 +89,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
11
79712
153
27847636