@bytecodealliance/jco 0.4.2 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -18,10 +18,10 @@
18
18
 
19
19
  Features include:
20
20
 
21
- * Creating WebAssembly Components from JavaScript sources and a WIT world
22
21
  * "Transpiling" Wasm Component binaries into ES modules that can run in any JS environment.
23
22
  * Optimization helpers for Components via Binaryen.
24
23
  * 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.
24
+ * "Componentize" for WebAssembly Components from JavaScript sources and a WIT world
25
25
 
26
26
  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.
27
27
 
@@ -65,16 +65,24 @@ Commands:
65
65
  help [command] display help for command
66
66
  ```
67
67
 
68
- ## API
68
+ ### Componentize
69
+
70
+ To componentize a JS file run:
69
71
 
70
- The below is an outline of the available API functions, see [api.d.ts](api.d.ts) file for the exact options.
72
+ ```
73
+ jco componentize app.js --world world.wit -o component.wasm
74
+ ```
71
75
 
72
- #### `componentize(jsSource: String, witWorld: String, opts?): Promise<{ component: Uint8Array }>`
76
+ Creates a component from a JS module implementing a WIT world definition, via a Spidermonkey engine embedding.
73
77
 
74
- Creates a component from a JS file and WIT world definition, via a Spidermonkey engine embedding.
78
+ Currently requires an explicit install of the componentize-js engine via `npm install @bytecodealliance/componentize-js`.
75
79
 
76
80
  See [ComponentizeJS](https://github.com/bytecodealliance/componentize-js) for more details on this process.
77
81
 
82
+ > Additional engines may be supported in future via an `--engine` field or otherwise.
83
+
84
+ ## API
85
+
78
86
  #### `transpile(component: Uint8Array, opts?): Promise<{ files: Record<string, Uint8Array> }>`
79
87
 
80
88
  Transpile a Component to JS.