
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
js-inline-wasm
Advanced tools
A tool for bundling a WebAssembly .wasm file into a .js library file with async loading.
A tool for bundling a WebAssembly .wasm file into a .js ES6 library file with async loading.
npm install -D js-inline-wasm
$ inlinewasm sample.wasm [--output sample.js] [--type fetch]
In package.json
scripts: {
"inlinewasm": "inlinewasm wasm/sample.wasm --output build/sample.js"
}
--input file The .wasm file to inline
-o, --output file The .js file to create
-t, --type typeName The type of JavaScript file to generate
-h, --help Show this Help page
Each type outputs a different variant of JavaScript file
Creates a JavaScript file with a default export function that can be used anywhere you could use fetch(). e.g.
import fetchSample from 'sample'; // sample.js contains the bundled .wasm
WebAssembly.instantiateStreaming(fetchSample)
.then(obj => obj.instance.exports.exported_func());
Creates a JavaScript file with a default export byte array containing the decoded .wasm content
Note: You'll probably want to use WebAssembly.instantiateStreaming() in most cases, as it is more efficient than instantiate().
import decodedSample from 'sample'; // sample.js contains the bundled .wasm
WebAssembly.instantiate(decodedSample)
.then(obj => obj.instance.exports.exported_func());
Creates a JavaScript file with a default export string value containing the base64 encoded .wasm file
import encodedSample from 'sample'; // sample.js contains the bundled .wasm
// Decode the base64 string then compile...
FAQs
A tool for bundling a WebAssembly .wasm file into a .js library file with async loading.
The npm package js-inline-wasm receives a total of 88 weekly downloads. As such, js-inline-wasm popularity was classified as not popular.
We found that js-inline-wasm demonstrated a not healthy version release cadence and project activity because the last version was released 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
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.