{"_id":"multimath","_rev":"9-8eed3eadd61c3f76de03e5d13258feff","name":"multimath","dist-tags":{"latest":"3.0.0"},"versions":{"1.0.0":{"name":"multimath","version":"1.0.0","keywords":["webassembly","math","image","multimath"],"license":"MIT","_id":"multimath@1.0.0","maintainers":[{"name":"vitaly","email":"vitaly@rcdesign.ru"}],"homepage":"https://github.com/nodeca/multimath#readme","bugs":{"url":"https://github.com/nodeca/multimath/issues"},"dist":{"shasum":"599745efdd1bfc4f818b6c60c718254d03543daf","tarball":"https://registry.npmjs.org/multimath/-/multimath-1.0.0.tgz","integrity":"sha512-blDjHP8XzW/vcWcF+hLDb6vA7W4Ea2grV3q+mZNZ6iVEZwKacPhj2KBH3CsAerpauVUtuq8chbJ5uP+WX/fLNw==","signatures":[{"sig":"MEUCIBmHICYZrOrP5vdxKflaFI3ZRaZ/Y87nVtyN35E+kIZPAiEAnsDtStfX2X6eQWef7jOqtFFyDkzpIaR69qiZNKBFqtw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"files":["lib/","index.js"],"gitHead":"18d84322431356ff358c571952b1544ee49670ec","scripts":{"test":"make test"},"_npmUser":{"name":"vitaly","email":"vitaly@rcdesign.ru"},"repository":{"url":"git+https://github.com/nodeca/multimath.git","type":"git"},"_npmVersion":"5.3.0","description":"Core to create fast image math in WebAssembly and JS.","directories":{},"_nodeVersion":"8.5.0","dependencies":{"glur":"^1.1.2","object-assign":"^4.1.1"},"devDependencies":{"mocha":"^3.1.0","eslint":"^3.7.0","benchmark":"^2.1.0"},"_npmOperationalInternal":{"tmp":"tmp/multimath-1.0.0.tgz_1506801385687_0.842715855455026","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"multimath","version":"1.0.1","keywords":["webassembly","math","image","multimath"],"license":"MIT","_id":"multimath@1.0.1","maintainers":[{"name":"vitaly","email":"vitaly@rcdesign.ru"}],"homepage":"https://github.com/nodeca/multimath#readme","bugs":{"url":"https://github.com/nodeca/multimath/issues"},"dist":{"shasum":"3144f1daf0f659ce8843a6ab570810c3cc59af16","tarball":"https://registry.npmjs.org/multimath/-/multimath-1.0.1.tgz","integrity":"sha512-rIwh9Uh7YEaY6X5w3MVW13FpPRoyEG9Lcfao1qYo/9MLwZpuJ2KgE+bOGeh3UbVE2AMy4xz4MevCYQmC8vA5sA==","signatures":[{"sig":"MEQCICPQcRL432bcXzJK7AE2Mep7qr7KyAxVdjgSIR0iPfosAiA9mCyd3AXs7nl4Ew2MO3nhVsym8vGLRq0T+4BPSugzvQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"files":["lib/","index.js"],"gitHead":"11a68ec8b3e5f2e49bc9ecdcfc955303ea5b2509","scripts":{"test":"make test"},"_npmUser":{"name":"vitaly","email":"vitaly@rcdesign.ru"},"repository":{"url":"git+https://github.com/nodeca/multimath.git","type":"git"},"_npmVersion":"5.3.0","description":"Core to create fast image math in WebAssembly and JS.","directories":{},"_nodeVersion":"8.5.0","dependencies":{"glur":"^1.1.2","object-assign":"^4.1.1"},"devDependencies":{"mocha":"^3.1.0","eslint":"^3.7.0","benchmark":"^2.1.0"},"_npmOperationalInternal":{"tmp":"tmp/multimath-1.0.1.tgz_1507014418644_0.05947004817426205","host":"s3://npm-registry-packages"}},"1.0.2":{"name":"multimath","version":"1.0.2","keywords":["webassembly","math","image","multimath"],"license":"MIT","_id":"multimath@1.0.2","maintainers":[{"name":"vitaly","email":"vitaly@rcdesign.ru"}],"homepage":"https://github.com/nodeca/multimath#readme","bugs":{"url":"https://github.com/nodeca/multimath/issues"},"dist":{"shasum":"89e80ad6a1f9eddc9a913af7e69550c386d62282","tarball":"https://registry.npmjs.org/multimath/-/multimath-1.0.2.tgz","integrity":"sha512-b/It27HkxVx8B9H5eaxyhALVdpAU/dGpjmQVveG1W0y7h0SQ8UOoOKL6ebHBPddd9ozNeRJNs/sDWm8FFVeZrQ==","signatures":[{"sig":"MEYCIQCoGYszvCw8hTiqqcm3RrHcoNws7UBed/CPEdCXQy2W5AIhALoJZQc2kZG88YJHwtdw1BI6rysd4vPTLFzYtAa+pz4l","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"files":["lib/","index.js"],"gitHead":"4103c508698eb117acfd01ccda497a4031655863","scripts":{"test":"make test","coverage":"nyc mocha && nyc report --reporter html"},"_npmUser":{"name":"vitaly","email":"vitaly@rcdesign.ru"},"repository":{"url":"git+https://github.com/nodeca/multimath.git","type":"git"},"_npmVersion":"5.3.0","description":"Core to create fast image math in WebAssembly and JS.","directories":{},"_nodeVersion":"8.5.0","dependencies":{"glur":"^1.1.2","object-assign":"^4.1.1"},"devDependencies":{"nyc":"^11.2.1","mocha":"^4.0.1","eslint":"^4.8.0","benchmark":"^2.1.0"},"_npmOperationalInternal":{"tmp":"tmp/multimath-1.0.2.tgz_1507873339285_0.22277664043940604","host":"s3://npm-registry-packages"}},"1.0.3":{"name":"multimath","version":"1.0.3","keywords":["webassembly","math","image","multimath"],"license":"MIT","_id":"multimath@1.0.3","maintainers":[{"name":"vitaly","email":"vitaly@rcdesign.ru"}],"homepage":"https://github.com/nodeca/multimath#readme","bugs":{"url":"https://github.com/nodeca/multimath/issues"},"dist":{"shasum":"eadee6fb9d727d329d64d60bba247af42334451d","tarball":"https://registry.npmjs.org/multimath/-/multimath-1.0.3.tgz","fileCount":15,"integrity":"sha512-Pfkai+VVbWSBL2XyzKIisZ2HFJ4a6lTWoyfjUUMu34bFkewmmYuG9/mB6l8/7O/Zs2Ap3u81ueKxTHoOmkZp4Q==","signatures":[{"sig":"MEQCIF2K/k4mYCZShvyjAVKxZ/Z9BwICeQpQu+5Utzedf3YYAiAk9mByJsANc2dJJtuTaYVAYnwQcb5xfeKPbvkgv/yYjA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":62487},"files":["lib/","index.js"],"gitHead":"983c310d2c682c7b1619edc53b4ce70208beb726","scripts":{"test":"make test","coverage":"nyc mocha && nyc report --reporter html"},"_npmUser":{"name":"vitaly","email":"vitaly@rcdesign.ru"},"repository":{"url":"git+https://github.com/nodeca/multimath.git","type":"git"},"_npmVersion":"5.5.1","description":"Core to create fast image math in WebAssembly and JS.","directories":{},"_nodeVersion":"8.9.1","dependencies":{"glur":"^1.1.2","object-assign":"^4.1.1"},"_hasShrinkwrap":false,"devDependencies":{"nyc":"^11.2.1","mocha":"^4.0.1","eslint":"^4.8.0","benchmark":"^2.1.0"},"_npmOperationalInternal":{"tmp":"tmp/multimath_1.0.3_1520241036846_0.5145968290266327","host":"s3://npm-registry-packages"}},"2.0.0":{"name":"multimath","version":"2.0.0","keywords":["webassembly","math","image","multimath"],"license":"MIT","_id":"multimath@2.0.0","maintainers":[{"name":"vitaly","email":"vitaly@rcdesign.ru"}],"homepage":"https://github.com/nodeca/multimath#readme","bugs":{"url":"https://github.com/nodeca/multimath/issues"},"dist":{"shasum":"0d37acf67c328f30e3d8c6b0d3209e6082710302","tarball":"https://registry.npmjs.org/multimath/-/multimath-2.0.0.tgz","fileCount":15,"integrity":"sha512-toRx66cAMJ+Ccz7pMIg38xSIrtnbozk0dchXezwQDMgQmbGpfxjtv68H+L00iFL8hxDaVjrmwAFSb3I6bg8Q2g==","signatures":[{"sig":"MEUCIQC45i+BIaZl2kfFxdr6L5q6TWZ/DBMKw98E7y4usciFTwIgSgrnhE8bhVvnJJcTQzwyjJJxfkEJVdd7zIz3LmqM89Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":62743,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdLGvVCRA9TVsSAnZWagAAcDAP/2GHKSub/flCz5DugHgL\n7Dh8VbgiCl4iIexCcjnJHpFBKcdBleKDr/3Q99WGeT3pDuA3dWKp4Q7CKRtm\nQ4f5YUDPXdguO+le28UgLeomqw3z9GirxvgLsTGH+60yAcEsoMIi4hjMsnsZ\nD2C2BEGjwPzyRGpaniKdIFUhHXIKkRfRdO5nJn2Bfbi8uEZD8Nxq1uejP9QY\nD5OWUJvhja4kkq3mOl5GDyIYix7s5Bg7jDnCb1poOJpXeg2Gd2pXxPcud8WN\nOlpNTZu7YRmGkyEKz8L0gnyBPnCyG+V97zsVTtieTrcU/wjmzES5SKrR1A0e\n3IQ98ID3kgDoo53lUzReW699x0Pw+qnXRxQRupe3uD2Z559Sc5cPD9Jy84yX\naYX1dkpXcdqLIf3f+XrDE/xvDWhLp0XI3V4RPbtZ4u2FPXD/3fe15rnj2tZM\njr8zLUDpX2HdjCDzowNN0Q+umH8IHVooS6yfyygMatOUlN/ZwQW1/A771DKC\nKsTZ7vUUijM9jcoYUt891p068PkemdSL7jUDgU7OTZxLLa6BlBmd7LTQMdPX\nBE3h+7suNVZrxTm0fLM1ADfnWsJf6RaRTzJbKJOgDsRTc37C5CXIoYtiNWKg\nW/vjXyk0GbCNWqgHEVhaPGkz6ClWAtL7wvsz3eB/FgB1kS4PhV/Isolxg53w\n7HJw\r\n=eevk\r\n-----END PGP SIGNATURE-----\r\n"},"gitHead":"b01997481f81209cbedcc03304d5b83b182ab352","scripts":{"test":"make test","coverage":"nyc mocha && nyc report --reporter html"},"_npmUser":{"name":"vitaly","email":"vitaly@rcdesign.ru"},"repository":{"url":"git+https://github.com/nodeca/multimath.git","type":"git"},"_npmVersion":"6.4.1","description":"Core to create fast image math in WebAssembly and JS.","directories":{},"_nodeVersion":"10.15.3","dependencies":{"glur":"^1.1.2","object-assign":"^4.1.1"},"_hasShrinkwrap":false,"devDependencies":{"nyc":"^14.1.1","mocha":"^6.1.4","sinon":"^7.3.2","eslint":"^6.0.1","benchmark":"^2.1.0","proxyquire":"^2.1.1"},"_npmOperationalInternal":{"tmp":"tmp/multimath_2.0.0_1563192276879_0.024262470496241972","host":"s3://npm-registry-packages"}},"3.0.0":{"name":"multimath","description":"Core to create fast image math in WebAssembly and JS.","version":"3.0.0","keywords":["webassembly","math","image","multimath"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/nodeca/multimath.git"},"scripts":{"build:llvm":"docker build -t multimath_llvm -f ./support/Dockerfile.llvm ./support && docker run --rm -v $(pwd):/src -u $(id -u):$(id -g) multimath_llvm ./support/compile-llvm.sh","build:emsdk":"docker run --rm -v $(pwd):/src -u $(id -u):$(id -g) emscripten/emsdk:2.0.20 ./support/compile-emsdk.sh","build":"npm run build:emsdk","lint":"eslint .","test":"npm run lint && c8 node --test","coverage":"npm run test && c8 report --reporter html"},"types":"./lib/index.d.ts","exports":{".":{"types":"./lib/index.d.ts","default":"./lib/index.mjs"},"./package.json":"./package.json"},"dependencies":{"glur":"^2.0.0"},"devDependencies":{"benchmark":"^2.1.0","eslint":"^9","neostandard":"^0.13.0","c8":"^10.0.0"},"_id":"multimath@3.0.0","gitHead":"47e52032b58932e381ff881396f7dd1a69c8a271","bugs":{"url":"https://github.com/nodeca/multimath/issues"},"homepage":"https://github.com/nodeca/multimath#readme","_nodeVersion":"22.22.2","_npmVersion":"10.9.7","dist":{"integrity":"sha512-U+s5xgbW55w5sbT9PeaJdEuxH5zL7wLwvp0MOJxXS8WhWDYnsTPIF3faeAltxkPNa+dDXmXs6gIiEpcCeE1YCA==","shasum":"5ac63e202fbd7cea8097000505c199b9b3a528fe","tarball":"https://registry.npmjs.org/multimath/-/multimath-3.0.0.tgz","fileCount":17,"unpackedSize":33949,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCSd7HG0NsM2QlTERsLnlRcfzV9qiisCaKo7aNLIcR2mQIhAP2uqijFurZJFSXvSkrpWkyxsvo5gUBtIHrwoe6j2+MH"}]},"_npmUser":{"name":"vitaly","email":"vitaly@rcopen.com"},"directories":{},"maintainers":[{"name":"vitaly","email":"vitaly@rcopen.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/multimath_3.0.0_1779052526634_0.17290043399896438"},"_hasShrinkwrap":false}},"time":{"created":"2017-09-30T19:56:26.753Z","modified":"2026-05-17T21:15:26.910Z","1.0.0":"2017-09-30T19:56:26.753Z","1.0.1":"2017-10-03T07:06:59.624Z","1.0.2":"2017-10-13T05:42:20.431Z","1.0.3":"2018-03-05T09:10:36.920Z","2.0.0":"2019-07-15T12:04:36.981Z","3.0.0":"2026-05-17T21:15:26.789Z"},"bugs":{"url":"https://github.com/nodeca/multimath/issues"},"license":"MIT","homepage":"https://github.com/nodeca/multimath#readme","keywords":["webassembly","math","image","multimath"],"repository":{"type":"git","url":"git+https://github.com/nodeca/multimath.git"},"description":"Core to create fast image math in WebAssembly and JS.","maintainers":[{"name":"vitaly","email":"vitaly@rcopen.com"}],"readme":"multimath\n=========\n\n[![NPM version](https://img.shields.io/npm/v/multimath.svg)](https://www.npmjs.org/package/multimath)\n\n> Core to create fast image math in WebAssembly and JS.\n\n`multimath` simplifies creation of small CPU-intensive webassembly modules\nwith fallback to JavaScript implementations.\n\n- It cares about modules init, memory management and other things.\n- Has built-in helpers to write webassembly code without additional runtimes.\n- Use shared memory to chain webassembly calls without memory copy.\n\nBuilt-in functions (currently - unsharp mask) are available as examples for\nyour extensions.\n\n\nInstall\n-------\n\n```bash\nnpm install multimath\n```\n\n\nUse\n---\n\n```js\nimport { MultiMath, unsharp_mask_plugin } from 'multimath'\n\nconst mm = new MultiMath()\n             .use(unsharp_mask_plugin)\n             .use(your_custom_plugin)\n\n// Simple sync call. Will use sync wasm compile. Ok for webworkers.\n// Can freeze interface at first call if wasm source is too big.\nmm.unsharp_mask(rgba_buffer, width, height)\n\n// Async init, compile all modules at once in async way.\nawait mm.init()\nmm.unsharp_mask(rgba_buffer, width, height)\n```\n\n\nAPI\n---\n\n\n### new MultiMath(options)\n\nCreate library instance.\n\n```js\nconst mm = new MultiMath({\n  // Options are not mandatory, but you can disable js or wasm\n  // implementations for testing\n  js:   true,\n  wasm: true\n})\n```\n\n\n### .use(plugin)\n\nRegister new plugin, format is:\n\n```js\n{\n  name:     String,    // method name to expose on instance\n  fn:       Function,  // JS implementation\n  wasm_fn:  Function,  // WebAssembly glue\n  wasm_src: String     // Base64 encoded WebAssembly module\n}\n```\n\nSee `lib/unsharp_mask_plugin/` as an example implementation.\n\n\n### .init() -> Promise\n\nOptional. Compile all wasm modules asynchronously. Useful when:\n\n1. Wasm module > 4K AND running in the main thread (not in a webworker).\n   Some browsers prohibit sync wasm creation in this case.\n2. Many small modules that should all be initialized before first use.\n\nNote: a 3K wasm file initializes in ~3ms.\n\n\n### .<your_method>\n\nAll plugins loaded via `.use()` pin their methods to the `MultiMath` instance.\nThe best implementation is selected automatically based on browser features\nand constructor options.\n\n\n### Development\n\nWays to go with your own plugins:\n\n- See `lib/unsharp_mask_plugin/` as an example.\n- See how [pica](https://github.com/nodeca/pica) uses this library.\n","readmeFilename":"README.md","users":{"merbst":true}}