webassembly-loader-sw
Version:
Webpack loader for WebAssembly (like wasm-loader but have different export options)
10 lines (9 loc) • 463 B
TypeScript
/// <reference types="node" />
import { TransformModuleOptions } from './options';
/** Transform WebAssembly binary into JS module
* @param source - WebAssembly Buffer
* @param options - what type of export you want to generate
* @return string of the code
* @example const code = wasm2js(Buffer.from([0x00, 0x61, 0x73, 0x6d, 0x01, 0, 0, 0]), 'instance')
*/
export default function (source: Buffer, options: TransformModuleOptions): string | never;