Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
@webassemblyjs/wast-printer
Advanced tools
The @webassemblyjs/wast-printer package is a tool for converting WebAssembly binary format (Wasm) into WebAssembly Text format (WAT), also known as WAST. This is particularly useful for debugging, optimization, and learning purposes, as WAT is a human-readable representation of WebAssembly code.
Printing Wasm to WAT
This feature allows you to parse a WAST string to create an abstract syntax tree (AST) and then print that AST back into a WAST string. It's useful for generating human-readable WAT/WAST from WebAssembly binaries or ASTs.
"const { parse } = require('@webassemblyjs/wast-parser');\nconst { print } = require('@webassemblyjs/wast-printer');\nconst wast = '(module)';\nconst ast = parse(wast);\nconst output = print(ast);\nconsole.log(output);"
The 'wabt' package is a set of tools built around the WebAssembly Binary Toolkit. It includes functionality to convert Wasm binaries to WAT and vice versa, similar to what @webassemblyjs/wast-printer offers. However, 'wabt' provides a broader set of utilities for WebAssembly manipulation, including validation and execution of Wasm code.
Binaryen is a compiler and toolchain infrastructure library for WebAssembly, written in C++. It has bindings for Node.js ('binaryen' npm package), allowing similar functionalities to @webassemblyjs/wast-printer, such as converting between Wasm and WAT. In addition to printing and parsing, Binaryen focuses on optimization, providing tools to generate and optimize WebAssembly code programmatically.
WebAssembly text format printer
yarn add @webassemblyjs/wast-printer
import { print } from "@webassemblyjs/wast-printer"
console.log(print(ast));
FAQs
WebAssembly text format printer
The npm package @webassemblyjs/wast-printer receives a total of 14,840,062 weekly downloads. As such, @webassemblyjs/wast-printer popularity was classified as popular.
We found that @webassemblyjs/wast-printer demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.