Socket
Socket
Sign inDemoInstall

@bytecodealliance/jco

Package Overview
Dependencies
Maintainers
3
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bytecodealliance/jco - npm Package Compare versions

Comparing version 0.4.2 to 0.5.0

wasi_snapshot_preview1.command.wasm

2

package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc