
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
emscripten-wasm-loader
Advanced tools
Common interface to load wasm module into isomorphic environment
Wraps up common initialization logic with predefined preprocessor object.
import { getModuleLoader } from 'emscripten-wasm-loader';
const loader = getModuleLoader(factoryLoader, {dir: 'path', runtimeModule: require('wasm/wasmlibaray') }, { additional: ''});
getModuleLoader
is higher order function returns actual module loader.
getModuleLoader<T, R extends AsmRuntimeType>(
factoryLoader: (runtime: R) => T,
asm: { dir: string | null; runtimeModule: runtimeModuleType },
module?: stringMap
) => moduleLoaderType<T>;
/**
* Asynchronously load and initialize asm module.
*
* @param {string} [binaryEndpoint] Provides endpoint to server to download binary module
* (.wasm, .mem) via fetch when initialize module in a browser environment.
* @param {ENVIRONMENT} [environment] Override running environment to load binary module.
* This option is mostly for Electron's renderer process, which is detected as node.js env by default
* but in case of would like to use fetch to download binary module.
*
* @returns {T} Factory function manages lifecycle of hunspell and virtual files.
*/
type moduleLoaderType<T> = (binaryEndpoint?: string, environment?: ENVIRONMENT) => Promise<T>;
factoryLoader
is function to create actual instance of module using initialized wasm binary runtime. asm
requires 2 values, dir
is absolute path of wasm
or mem
binary location, and runtimeModule
is function loaded via require
to emscripten preamble js for wasm binaries. It expected wasm binary should be built with MODULARIZE=1
option so runtimeModule
can be function to be executed. In case of dir
, it's node.js only option and will be ignored on browser environment. Lastly module
is object to be inherited when execute runtimeModule
. Emscripten's modularized preamble construct scoped wasm runtime module named Module
, allows to have predefined object if needed. Internally getModuleLoader
augments given object and set default interfaces like initializeRuntime
.
FAQs
Common interface to load wasm module into isomorphic environment
The npm package emscripten-wasm-loader receives a total of 10,780 weekly downloads. As such, emscripten-wasm-loader popularity was classified as popular.
We found that emscripten-wasm-loader 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.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.