Socket
Socket
Sign inDemoInstall

@webassemblyjs/wasm-parser

Package Overview
Dependencies
10
Maintainers
1
Versions
86
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @webassemblyjs/wasm-parser

WebAssembly binary format parser


Version published
Weekly downloads
23M
increased by2.74%
Maintainers
1
Install size
447 kB
Created
Weekly downloads
 

Package description

What is @webassemblyjs/wasm-parser?

The @webassemblyjs/wasm-parser package is a tool for parsing WebAssembly binaries (.wasm files) into a format that is easier to interact with in JavaScript. It can be used to analyze and manipulate WebAssembly modules without having to execute them.

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

Parsing WebAssembly binaries

This feature allows you to parse .wasm files into an abstract syntax tree (AST) that represents the structure and content of the WebAssembly module.

const { decode } = require('@webassemblyjs/wasm-parser');
const fs = require('fs');

const wasmBuffer = fs.readFileSync('module.wasm');
const ast = decode(wasmBuffer);

console.log(ast);

Other packages similar to @webassemblyjs/wasm-parser

Readme

Source

@webassemblyjs/wasm-parser

WebAssembly binary format parser

Installation

yarn add @webassemblyjs/wasm-parser

Usage

import { decode } from "@webassemblyjs/wasm-parser";
import { readFileSync } from "fs";

const binary = readFileSync("/path/to/module.wasm");

const decoderOpts = {};
const ast = decode(binary, decoderOpts);

Decoder options

  • dump: print dump information while decoding (default false)
  • ignoreCodeSection: ignore the code section (default false)
  • ignoreDataSection: ignore the data section (default false)

Keywords

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