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

@webassemblyjs/wasm-gen

Package Overview
Dependencies
Maintainers
1
Versions
87
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@webassemblyjs/wasm-gen

WebAssembly binary format printer

  • 1.11.6
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
20M
decreased by-6.42%
Maintainers
1
Weekly downloads
 
Created

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

Package last updated on 09 May 2023

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