New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

binaryen

Package Overview
Dependencies
Maintainers
2
Versions
1627
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

binaryen

JavaScript version of Binaryen, a compiler infrastructure and toolchain library for WebAssembly.

  • 39.0.0-nightly.20171116
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
106K
decreased by-13.8%
Maintainers
2
Weekly downloads
 
Created

What is binaryen?

Binaryen is a compiler and toolchain infrastructure library for WebAssembly, written in C++. It is designed to make compiling to WebAssembly easy, fast, and effective. It provides a variety of tools and libraries to optimize and manipulate WebAssembly code.

What are binaryen's main functionalities?

WebAssembly Module Creation

This feature allows you to create and manipulate WebAssembly modules. The code sample demonstrates creating a simple WebAssembly function that adds two integers.

const binaryen = require('binaryen');
const module = new binaryen.Module();
module.addFunction('add', binaryen.i32, binaryen.i32, [binaryen.i32, binaryen.i32], module.i32.add(module.local.get(0, binaryen.i32), module.local.get(1, binaryen.i32)));
module.validate();
console.log(module.emitText());

Optimization

Binaryen provides optimization capabilities for WebAssembly modules. The code sample shows how to optimize a module, which can improve performance and reduce size.

const binaryen = require('binaryen');
const module = new binaryen.Module();
// Add functions and other elements to the module
module.optimize();
console.log(module.emitText());

Validation

This feature allows you to validate WebAssembly modules to ensure they are well-formed and adhere to the WebAssembly specification. The code sample demonstrates how to validate a module.

const binaryen = require('binaryen');
const module = new binaryen.Module();
// Add functions and other elements to the module
const isValid = module.validate();
console.log('Module is valid:', isValid);

Other packages similar to binaryen

Keywords

FAQs

Package last updated on 16 Nov 2017

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