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

nano-benchmark

v1.0.15

Published

CLI micro-benchmarking with nonparametric statistics and significance testing.

Readme

nano-benchmark NPM version

nano-benchmark provides command-line utilities for micro-benchmarking code with nonparametric statistics and significance testing.

Two utilities are available:

  • nano-watch — continuously benchmarks a single function, showing live statistics and memory usage.
  • nano-bench — benchmarks and compares multiple functions, calculating confidence intervals and statistical significance.

Designed for performance tuning of small, fast code snippets used in tight loops.

Visual samples

nano-watch

nano-watch

nano-bench

nano-bench

Installation

npm install nano-benchmark

Deno and Bun support

Use --self to get the script path for Deno and Bun:

npx nano-bench benchmark.js
bun `npx nano-bench --self` benchmark.js
deno run --allow-read --allow-hrtime `npx nano-bench --self` benchmark.js
deno run -A `npx nano-bench --self` benchmark.js
node `npx nano-bench --self` benchmark.js

For Deno, --allow-read is required and --allow-hrtime is recommended. Use -A for convenience in safe environments.

Documentation

With a global install (npm install -g nano-benchmark) both utilities are available by name. Otherwise, prefix with npx (e.g., npx nano-watch) or add them to your package.json scripts. Run with --help for details on arguments.

Both utilities import a module and benchmark its (default) export. nano-bench expects an object whose properties are the functions to compare. nano-watch accepts the same format or a single function.

Example module for nano-bench (bench-strings-concat.js):

export default {
  strings: n => {
    const a = 'a',
      b = 'b';
    for (let i = 0; i < n; ++i) {
      const x = a + '-' + b;
    }
  },
  backticks: n => {
    const a = 'a',
      b = 'b';
    for (let i = 0; i < n; ++i) {
      const x = `${a}-${b}`;
    }
  },
  join: n => {
    const a = 'a',
      b = 'b';
    for (let i = 0; i < n; ++i) {
      const x = [a, b].join('-');
    }
  }
};

Usage:

npx nano-bench bench-strings-concat.js
npx nano-watch bench-strings-concat.js backticks

See wiki for more details.

AI agents and contributing

AI agents and AI-assisted developers: read AGENTS.md first for project rules and conventions.

Other useful files:

License

BSD 3-Clause License

Release history

  • 1.0.15: Updated dependencies.
  • 1.0.14: Fixed Kruskal-Wallis post-hoc (Conover-Iman) pairwise comparison bug: corrected rank variance computation and critical value distribution. Added regression test.
  • 1.0.13: Improved CLI help texts and documentation for brevity and clarity.
  • 1.0.12: Added AI coding skills for writing benchmark files (write-bench, write-watch), shipped via npm. Added findLevel() tests. Expanded test suite.
  • 1.0.11: Fixed MedianCounter.clone() bug, expanded test suite (204 tests), added CodeQL workflow, multi-OS CI matrix, and new Windsurf workflows.
  • 1.0.10: Added Prettier lint scripts, GitHub issue templates, Copilot instructions, and Windsurf workflows.
  • 1.0.9: Updated dependencies.
  • 1.0.8: Updated dependencies.
  • 1.0.7: Updated dependencies.
  • 1.0.6: Updated dependencies.
  • 1.0.5: Updated dependencies.
  • 1.0.4: Updated dependencies + added more tests.
  • 1.0.3: Updated dependencies.
  • 1.0.2: Added the --self option.
  • 1.0.1: Added "self" argument to utilities so it can be used with Deno, Bun, etc.
  • 1.0.0: Initial release.