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

helix-noise-wasm

v0.1.0

Published

WebAssembly bindings for helix-noise — divergence-free helical (Beltrami) flow-field noise, compiled from the Rust core with wasm-bindgen. Spectral + sparse-atom engines.

Readme

helix-noise-wasm

WebAssembly build of helix-noise, compiled from the Rust core with wasm-bindgen. Divergence-free helical (Beltrami) flow-field noise — sample a smooth, incompressible 3-D velocity field at any point in space and time, with vorticity and vector potential in closed form. No FFT, no grid, no simulation.

Same algorithm and same seeds as every other port: the wasm output matches the JS reference to 1e-9 (tests/parity.test.mjs). Both engines are exposed:

  • Field — the spectral engine (a sum of helical modes; O(modes) per sample).
  • Atoms — the sparse-atom engine (compactly-supported helical wavelets on a spatial hash; infinite, grid-free, amortized O(1) per sample).

Build

The .wasm and its JS glue are a build artifact (pkg/), produced by wasm-pack:

# once: rustup target add wasm32-unknown-unknown  &&  cargo install wasm-pack
cd packages/wasm
wasm-pack build --target web --out-dir pkg      # or --target bundler / nodejs
node tests/parity.test.mjs                       # numerical parity vs the JS reference

--target web emits an ES module you initialize with a .wasm URL; use --target bundler for webpack/Vite or --target nodejs for CommonJS require.

Use (web target)

import init, { Field, Atoms, version } from "./pkg/helix_noise_wasm.js";

await init();                         // fetches the .wasm alongside the JS glue

const f = new Field({ modes: 48, helicity: 0.8, coherence: 0.5, seed: 42 });
const [u, v, w] = f.sample(1.0, 2.0, 3.0);        // velocity → Float64Array(3)
const uw = f.sampleUW(1, 2, 3, 0.5);              // [u,v,w, wx,wy,wz]
const tex = f.bake3d(32, 0);                      // Float32Array, RGBA volume (rgb=vel, a=helicity)

const a = new Atoms({ octaves: 4, helicity: 0.7, seed: 7 });
const vel = a.sampleMany(new Float64Array([x0, y0, z0, x1, y1, z1]), 0); // batch → [u,v,w, ...]

API surface

Field and Atoms share the sampling API: sample, sampleT, sampleUW (velocity + vorticity), sampleUA (velocity + potential), vorticity, helicityDensity, potential, sampleMany, bake3d, bake2d. Field adds modes() and glsl(name?, potential?); Atoms adds relativeHelicity(ng). Options are a plain JS object — see the reference docs for every field.

The Rust-native callback options (spectrum, helicityField, gainField) are not exposed across the wasm boundary; use the Rust crate directly if you need them.

License

MIT © Rifat Jumagulov.