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

webassemblyjs

Package Overview
Dependencies
Maintainers
1
Versions
96
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webassemblyjs

WebAssembly interpreter

  • 1.7.0-2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
124K
increased by374.92%
Maintainers
1
Weekly downloads
 
Created

What is webassemblyjs?

The webassemblyjs package is a collection of tools designed to work with WebAssembly (Wasm) modules. It provides functionalities for parsing, editing, and generating WebAssembly binary and text formats, making it useful for developers working with Wasm directly.

What are webassemblyjs's main functionalities?

Parsing WebAssembly

This feature allows you to parse a WebAssembly binary into an Abstract Syntax Tree (AST). The code sample demonstrates how to use the wasm-parser module to decode a binary into its AST representation.

const { decode } = require('@webassemblyjs/wasm-parser');
const binary = new Uint8Array([0x00, 0x61, 0x73, 0x6d]);
const ast = decode(binary);
console.log(ast);

Editing WebAssembly

This feature provides the ability to edit a WebAssembly AST. The code sample shows how to modify an export name within an AST using the edit function from the ast module.

const { edit } = require('@webassemblyjs/ast');
const ast = {}; // Assume this is a pre-existing AST
edit(ast, {
  ModuleExport: ({ node }) => {
    node.name = 'newExportName';
  }
});

Generating WebAssembly

This feature allows you to generate a WebAssembly binary from an AST. The code sample demonstrates how to use the wasm-gen module to encode an AST back into a binary format.

const { encode } = require('@webassemblyjs/wasm-gen');
const ast = {}; // Assume this is a pre-existing AST
const binary = encode(ast);
console.log(binary);

Other packages similar to webassemblyjs

Keywords

FAQs

Package last updated on 18 Jul 2018

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