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

wabt

Package Overview
Dependencies
Maintainers
2
Versions
474
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wabt

JavaScript version of WABT, The WebAssembly Binary Toolkit, with TypeScript support.

  • 0.0.13-nightly.20170624
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
14K
increased by7.17%
Maintainers
2
Weekly downloads
 
Created
Source

wabt.js

npm

JavaScript version of WABT, the WebAssembly Binary Toolkit.

Usage

$> npm install wabt
var wabt = require("wabt");

var wasm = ...; // a buffer holding the contents of a wasm file

var myModule = wabt.readWasm(wasm, { readDebugNames: true });
myModule.applyNames();

var wast = myModule.toText({ foldExprs: false, inlineExport: false });

console.log(wast);

API

  • parseWast(filename: string, buffer: string | Uint8Array): WasmModule
    Parses a wast source to a module.

  • readWasm(buffer: Uint8Array, options: IReadWasmOptions): WasmModule
    Reads a wasm binaryen to a module.

  • WasmModule
    A class representing a WebAssembly module.

    • generateNames(): void
      Generates textual names for function types, globals, labels etc.
    • applyNames(): void
      Applies textual names.
    • toText(options: IToTextOptions): string
      Converts the module to wast text format.
    • toBinary(options: IToBinaryOptions): IToBinaryResult
      Converts the module to a wasm binary.
    • destroy(): void
      Disposes the module and frees its resources.
  • IReadWasmOptions
    Options modifying the behavior of readWasm.

    • readDebugNames: boolean
      Reads textual names from the name section.
  • IToTextOptions
    Options modifying the behavior of WasmModule#toText.

    • foldExprs: boolean
    • inlineExport: boolean
  • IToBinaryOptions
    Options modifying the behavior of WasmModule#toBinary.

    • log: boolean
    • canonicalize_lebs: boolean
    • relocatable: boolean
    • write_debug_names: boolean
  • IToBinaryResult
    Result object of WasmModule#toBinary.

    • buffer: Uint8Array
      The wasm binary buffer.

    • log: string
      Generated log output.

Keywords

FAQs

Package last updated on 24 Jun 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