simplex-noise
A fast, dependency-free simplex noise implementation for JavaScript and TypeScript
Repository Health
Technical Analysis
simplex-noise is a small, self-contained port of Ken Perlin’s simplex noise algorithm (via Stefan Gustavson and Peter Eastman’s reference implementation) to JavaScript and TypeScript. It exposes tree-shakeable createNoise2D/createNoise3D/createNoise4D factory functions that each return a pure noise function, runs in both the browser and Node.js via CommonJS or ES Modules, and benchmarks at tens of millions of calls per second on a single thread. Because it’s dependency-free and about 2KB minified and gzipped, it’s a common building block for procedural generation, generative art, and terrain/texture synthesis.
What You Get
createNoise2D,createNoise3D, andcreateNoise4Dfactory functions, each returning a fast noise-sampling function- Optional custom PRNG seeding (e.g. via the companion
aleapackage) for reproducible noise fields - Tree-shakeable ES Module and CommonJS builds with full TypeScript type definitions
- A dependency-free, ~2KB minified+gzipped bundle with 100% test coverage and snapshot-tested output
Common Use Cases
- Generating procedural terrain, textures, or voxel worlds in games and 3D graphics
- Driving generative art, plasma effects, and shader-like visual effects on canvas or WebGL
- Producing organic-looking film grain or noise overlays in image/video processing pipelines
- Creating reproducible, seeded noise fields for procedural generation that need deterministic output
Under The Hood
Architecture - The entire library lives in a single file, simplex-noise.ts, which precomputes gradient tables (grad2/grad3/grad4 as Float64Arrays) and skew/unskew constants (F2/G2 through F4/G4) at module load time, then exposes createNoise2D/createNoise3D/createNoise4D factory functions that close over a permutation table built once per call and return a small, allocation-free noise-sampling function optimized with a fastFloor integer-coercion trick for speed. Tech Stack - Written in TypeScript with no runtime dependencies, built via a custom build.sh into separate CommonJS and ESM outputs (tsconfig-commonjs.json/tsconfig-esm.json), linted with a legacy .eslintrc.js, and tested with Mocha (.mocharc.json) plus snapshot-based visual regression tests that render PNGs into snapshots/ for 2D/3D/4D noise and the permutation table. Code Quality - test/simplex-noise-test.ts and test/matches-snapshot.ts exercise correctness and byte-for-byte snapshot stability across versions, the README states 100% test coverage as of the 4.x rewrite, and a perf/ directory benchmarks throughput; naming favors terse math-domain identifiers (F2, G3, fastFloor) typical of performance-critical numeric code rather than descriptive names, which is a common readability trade-off in this kind of library. API Design - The factory-function design (createNoise2D() returning a plain function) is deliberately minimal and tree-shakeable, replacing the older 3.x class-based new SimplexNoise() API; the README documents a clear 3.x-to-4.x migration path and seeding via an injectable PRNG, keeping the public surface small while still supporting reproducible output.
Used by 3 apps in this directory
Amical
Note Taking · AI Assistants
Local-first AI dictation that understands your active app — private, offline, and built for speed.
AutoGPT
Automation · Productivity · AI Assistants
Build, deploy, and run autonomous AI agents that automate complex multi-step workflows using a visual block-based graph editor.
superset
AI Code Assistants · AI Development
Orchestrate an army of AI coding agents—Claude Code, Codex, Gemini CLI, and more—running simultaneously in isolated git worktrees from a single Electron desktop app.