{"bin":{"jsct":"cli.mjs"},"bugs":{"url":"https://github.com/bytecodealliance/js-component-tools/issues"},"dist":{"shasum":"a1d9c3d522ef0651ead23290ade4b2a983798f35","tarball":"https://registry.npmjs.org/js-component-tools/-/js-component-tools-0.3.0-beta.1.tgz","fileCount":9,"integrity":"sha512-zL96m1n2Fnn8EtvvNAccrJw/8ebj2a58QoQdr3VRlJuc/aU/orUdMLzIM2GcJjSyokTrjYB96WSLy4V7dWZJtA==","signatures":[{"sig":"MEQCIEDZzNRbqNzoIlP7lWzj75NJpMcujO6l4zzmOQFpxjNFAiAka/Y7jm+Y7Mq/eA6L59SiXLHxPALQHOnxcuuFqW1Gbg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":26875183,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj0bFHACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqM0Q/+Jgzzkdzu/TnXU/5+eQDr3nFW84OhzC6Jzr8Na8N3e01TzurF\r\np+sy1wUxVRmbIOpd6sNHe0We9uSZqeIF9bErAvxL5Sy0eLDQuz0erxOxaCdv\r\nKBC+YPGweLsrxI3feV1JyhgW9E/+sSVMjOsbKgrKIbq+lb0kL+rZsC0AtS/m\r\n8Qm/sxOtgXwHBhafYSu1/XzrU3dvm832i5VylK1KxP43M0yrXiygJZ1byFfZ\r\nvBj6oFAQXfe+cGbJaHB/R3fC8Y2hVUYiCzYJpJCKR5YUu5F9vgwT5T7QTSCI\r\n/tiCU3Bqf7C7x9jDElJW1Vm0dfHpgsVoFlQrmlKvEm2kKQ8JTJBrZXxO4jht\r\nZrXEqJQvQfXCjLsuZuHpV8sjsad0VjBuy9f8YgOjx0n0WjQW5g54nriSmMOF\r\nt+FOxgphPfDMb8wTD8Ha7mkJ6SX7f8GSS7fH9rfur4EqqJc6g9R7efLI906P\r\nyEEpmaoXu3GKkK5HlpMnoBW1QoEcZXc630tcSofJDJHsaNhncAfKbWgodKzW\r\ncr4yDmxIfWh5SoQZQnr8dwLeCOP+fra9mRExn1M9837wrDhECGM+esznQRJn\r\nuUDDJ+psBEnuA+bYgdpnx6iJnyv0+DU+KOCXUavLtnZXdzbZBd/x1k18dByZ\r\nIfVKUDr7Zsf2WbH9ZZ0g3QtResoNUdTfJ00=\r\n=FhA2\r\n-----END PGP SIGNATURE-----\r\n"},"name":"js-component-tools","types":"api.d.ts","author":{"name":"Guy Bedford"},"readme":"<div align=\"center\">\n  <h1><code>js-component-tools</code></h1>\n\n  <p>\n    <strong>JavaScript tooling for working with <a href=\"https://github.com/WebAssembly/component-model\">WebAssembly Components</a></strong>\n  </p>\n\n  <strong>A <a href=\"https://bytecodealliance.org/\">Bytecode Alliance</a> project</strong>\n\n  <p>\n    <a href=\"https://github.com/bytecodealliance/js-component-tools/actions?query=workflow%3ACI\"><img src=\"https://github.com/bytecodealliance/js-component-tools/workflows/CI/badge.svg\" alt=\"build status\" /></a>\n  </p>\n</div>\n\n## Overview\n\nJS Component Tools is a fully native JS tool for working with the emerging [WebAssembly Components](https://github.com/WebAssembly/component-model) specification in JavaScript.\n\nFeatures include:\n\n* \"Transpiling\" Wasm Component binaries into ES modules that can run in any JS environment.\n* Optimization helpers for Components via Binaryen\n* Component helpers available as a build of [Wasm Tools](https://github.com/bytecodealliance/wasm-tools).\n\nThis tool is designed primarily for working with already-created Component binaries, and not for creating Component binaries to begin with. For creating Components, 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.\n\n> **Note**: This is an experimental project, no guarantees are provided for stability or support and breaking changes may be made in future.\n\n## Installation\n\n```shell\nnpm install js-component-tools\n```\n\nJS Component Tools can be used as either a library or as a CLI via the `jsct` CLI command.\n\n## Example\n\nSee the [example workflow](EXAMPLE.md) page for a full usage example.\n\n## API\n\nThe below is an outline of the available API functions, see [api.d.ts](api.d.ts) file for the exact options.\n\n#### `transpile(component: Uint8Array, opts?): Promise<{ files: Record<string, Uint8Array> }>`\n\nTranspile a Component to JS.\n\n**Transpilation options:**\n\n* `name?: string` - name for the generated JS file.\n* `instantiation?: bool` - instead of a direct ES module, output the raw instantiation function for custom virtualization.\n* `map?: Record<string, string>` - remap component imports\n* `validLiftingOptimization?: bool` - optimization to reduce code size\n* `noNodejsCompat?: bool` - disables Node.js compatible output\n* `tlaCompat?: bool` - enable compat in JS runtimes without TLA support\n* `base64Cutoff?: number` - size in bytes, under which Wasm modules get inlined as base64.\n* `js?: bool` - convert Wasm into JS instead for execution compatibility in JS environments without Wasm support.\n* `minify?: bool` - minify the output JS.\n* `optimize?: bool` - optimize the component with Binaryen wasm-opt first.\n* `optArgs?: string[]` - if using optimize, custom optimization options (defaults to best optimization, but this is very slow)\n\n#### `opt(component: Uint8Array, opts?): Promise<{ component: Uint8Array }>`\n\nOptimize a Component with the [Binaryen Wasm-opt](https://www.npmjs.com/package/binaryen) project.\n\n#### `parse(wat: string): Uint8Array`\n\nParse a compoment WAT to output a Component binary.\n\n#### `print(component: Uint8Array): string`\n\nPrint the WAT for a Component binary.\n\n#### `componentNew(coreWasm: Uint8Array | null, adapters?: [String, Uint8Array][]): Uint8Array`\n\n\"WIT Component\" Component creation tool, optionally providing a set of named adapter binaries.\n\n#### `componentWit(component: Uint8Array, document?: string): string`\n\nExtract the WIT world from a component binary.\n\n## CLI\n\n```shell\nUsage: jsct <command> [options]\n\nJSCT - WebAssembly JS Component Tools\n       JS Component Transpilation Bindgen & Wasm Tools for JS\n\nOptions:\n  -V, --version                         output the version number\n  -h, --help                            display help for command\n\nCommands:\n  transpile [options] <component-path>  Transpile a WebAssembly Component to JS + core Wasm for JavaScript execution\n  opt [options] <component-file>        optimizes a Wasm component, including running wasm-opt Binaryen optimizations\n  wit [options] <component-path>        extract the WIT from a WebAssembly Component [wasm-tools component wit]\n  print [options] <input>               print the WebAssembly WAT text for a binary file [wasm-tools print]\n  parse [options] <input>               parses the Wasm text format into a binary file [wasm-tools parse]\n  new [options] [module]                create a WebAssembly component adapted from a component core Wasm [wasm-tools component new]\n  help [command]                        display help for command\n```\n\n## Contributing\n\nDevelopment is based on a standard `npm install && npm run build && npm run test` workflow.\n\nTests can be run without bundling via `npm run build:dev && npm run test:dev`.\n\nSpecific tests can be run adding the mocha `--grep` flag, for example: `npm run test:dev -- --grep exports_only`.\n\n# License\n\nThis project is licensed under the Apache 2.0 license with the LLVM exception.\nSee [LICENSE](LICENSE) for more details.\n\n### Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in this project by you, as defined in the Apache-2.0 license,\nshall be licensed as above, without any additional terms or conditions.","exports":"./api.mjs","gitHead":"cd0dc0ab26d6f59ee54715db922f33b7023c897a","license":"(Apache-2.0 WITH LLVM-exception)","_npmUser":{"name":"guybedford","email":"guybedford@gmail.com"},"homepage":"https://github.com/bytecodealliance/js-component-tools#readme","keywords":["Wasm","WebAssembly","Component"],"repository":{"url":"git+https://github.com/bytecodealliance/js-component-tools.git","type":"git"},"_npmVersion":"8.19.2","description":"JavaScript tooling for working with WebAssembly Components","directories":{},"maintainers":[{"name":"guybedford","email":"guybedford@gmail.com"}],"_nodeVersion":"18.10.0","_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/js-component-tools_0.3.0-beta.1_1674686790726_0.1954934599818441","host":"s3://npm-registry-packages"},"_id":"js-component-tools@0.3.0-beta.1","version":"0.3.0-beta.1"}