npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

multimath

v3.0.0

Published

Core to create fast image math in WebAssembly and JS.

Downloads

1,709,388

Readme

multimath

NPM version

Core to create fast image math in WebAssembly and JS.

multimath simplifies creation of small CPU-intensive webassembly modules with fallback to JavaScript implementations.

  • It cares about modules init, memory management and other things.
  • Has built-in helpers to write webassembly code without additional runtimes.
  • Use shared memory to chain webassembly calls without memory copy.

Built-in functions (currently - unsharp mask) are available as examples for your extensions.

Install

npm install multimath

Use

import { MultiMath, unsharp_mask_plugin } from 'multimath'

const mm = new MultiMath()
             .use(unsharp_mask_plugin)
             .use(your_custom_plugin)

// Simple sync call. Will use sync wasm compile. Ok for webworkers.
// Can freeze interface at first call if wasm source is too big.
mm.unsharp_mask(rgba_buffer, width, height)

// Async init, compile all modules at once in async way.
await mm.init()
mm.unsharp_mask(rgba_buffer, width, height)

API

new MultiMath(options)

Create library instance.

const mm = new MultiMath({
  // Options are not mandatory, but you can disable js or wasm
  // implementations for testing
  js:   true,
  wasm: true
})

.use(plugin)

Register new plugin, format is:

{
  name:     String,    // method name to expose on instance
  fn:       Function,  // JS implementation
  wasm_fn:  Function,  // WebAssembly glue
  wasm_src: String     // Base64 encoded WebAssembly module
}

See lib/unsharp_mask_plugin/ as an example implementation.

.init() -> Promise

Optional. Compile all wasm modules asynchronously. Useful when:

  1. Wasm module > 4K AND running in the main thread (not in a webworker). Some browsers prohibit sync wasm creation in this case.
  2. Many small modules that should all be initialized before first use.

Note: a 3K wasm file initializes in ~3ms.

.<your_method>

All plugins loaded via .use() pin their methods to the MultiMath instance. The best implementation is selected automatically based on browser features and constructor options.

Development

Ways to go with your own plugins:

  • See lib/unsharp_mask_plugin/ as an example.
  • See how pica uses this library.