Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

walt-cli

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

walt-cli

CLI for Walt

  • 0.4.10
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

walt-cli

Line wrapper around the Walt WebAssembly Compiler. Intended to be used to build and package node modules utilizing WebAssembly/Walt. For browser integration use the webpack-loader.

Install

npm install --save-dev walt-cli

In your package.json

{
  "scripts": {
    "walt": "walt-cli"
  }
}

Usage

Compiling a single walt file to wasm

For one to one transforms point the cli at a single Walt file to get a single wasm result file.

npm run walt -- index.walt -o index.wasm

Compiling a walt program

For walt programs which has imports use the wrap flag -w. Wrap option will link and compile all dependencies starting from the entry file. The result is a self contained JavaScript module which exports a factory function. Use it to generate the WebAssembly instance of your walt program.

npm run walt -- src/walt/entry.walt -o walt-program.js -w

Once compiled the module can be imported just like any other JS module

const makeProgram = require("./walt-program");
// Factory takes an imports object
makeProgram({
  env: {
    memory: new WebAssembly.Memory({ initial: 1 })
  }
}).then(result => {
  result.instance.exports.run();
});

Note on imports:

All walt imports starting with a relative path ./paht-to-something is treated as a walt module import. All absolute imports are left to you to provide and are shared between all modules. Every module will get the same version of the import object provided.

Keywords

FAQs

Package last updated on 02 Jan 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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