
Security News
MCP Community Begins Work on Official MCP Metaregistry
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
esbuild-plugin-wasm
Advanced tools
An asynchronous .wasm
file loader for esbuild. This allows you to directly import .wasm
files as if they were a javascript module, similar to how it works in Webpack.
This plugin follows the WebAssembly/ES Module Integration proposal for loading WebAssembly from a JavaScript import statement.
This loader makes use of top-level await, which only has partial support in esbuild. For now, it is only supported with the esm
output format, not the iife
or cjs
formats. See https://github.com/evanw/esbuild/issues/253
npm install --save-dev esbuild-plugin-wasm
or
yarn add --dev esbuild-plugin-wasm
Add it to your esbuild plugins list
// build.ts
import esbuild from 'esbuild';
import wasmLoader from 'esbuild-plugin-wasm';
esbuild.build({
...
plugins: [
wasmLoader()
]
...
});
Then import your wasm
// app.ts
import wasm from "./lib.wasm";
console(wasm.add(1, 2));
wasmLoader({
// (Default) Deferred mode copies the WASM binary to the output directory,
// and then `fetch()`s it at runtime. This is the perffered mode.
mode: 'deferred'
// Embedded mode embeds the WASM binary in the javascript bundle as a
// base64 string. Note this will greatly bloat the resulting bundle
// (the binary will take up about 30% more space this way)
mode: 'embedded'
})
FAQs
A WASM file loader for esbuild.
The npm package esbuild-plugin-wasm receives a total of 7,923 weekly downloads. As such, esbuild-plugin-wasm popularity was classified as popular.
We found that esbuild-plugin-wasm demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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 MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
Research
Security News
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.
Research
Security News
Malicious npm packages posing as developer tools target macOS Cursor IDE users, stealing credentials and modifying files to gain persistent backdoor access.