Socket
Socket
Sign inDemoInstall

@webassemblyjs/wasm-gen

Package Overview
Dependencies
10
Maintainers
1
Versions
84
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@webassemblyjs/wasm-gen

WebAssembly binary format printer


Version published
Maintainers
1
Weekly downloads
22,410,706
decreased by-6.93%

Weekly downloads

Package description

What is @webassemblyjs/wasm-gen?

The @webassemblyjs/wasm-gen package is a tool that allows for the generation of WebAssembly binary code. It is part of the WebAssembly.js project which aims to provide a set of tools to compile, decompile, validate, and manipulate WebAssembly modules. With wasm-gen, developers can programmatically create WebAssembly binaries using an Abstract Syntax Tree (AST) representation of the code.

What are @webassemblyjs/wasm-gen's main functionalities?

Generating WebAssembly binary

This feature allows the generation of WebAssembly binary code from an AST. The code sample demonstrates how to create a simple WebAssembly module with no imports, one function, and no exports, and then encode it into a binary format.

const { encode } = require('@webassemblyjs/wasm-gen');
const t = require('@webassemblyjs/ast');

const module = t.module(
  [],
  [
    t.func(t.indexLiteral(0), [], [], [])
  ],
  []
);

const binary = encode(module);
console.log(binary);

Other packages similar to @webassemblyjs/wasm-gen

FAQs

Last updated on 09 May 2023

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc