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

hbu

v0.3.5

Published

How's by u? A performance analysis CLI

Downloads

97

Readme

How's by u?

Performance testing CLI

Install

npm i -D hbu

...or, globally, if you must:

npm i -g hbu

Example

There is a file called basic.js inside the ./example directory which looks like this:

const { start, end, times } = require('hbu');

const data = {
    a: "a",
    b: "b",
    c: "c"
};

const leak = [];

let i = 0;

start();

while (i < times) {
    leak.push(JSON.parse(JSON.stringify(data)));
    i++;
}

end();

As shown, simply import hbu and use the given start, end and times exports to write your test scenario.

Run your test, like so:

$ hbu './example/basic.js' --times 1000000 --gc-stats
| Test Label   | Heap Used (MB) | Duration (MS) | GC Collected Heap (MB) | GC Pause Duration (MS) | GC Events (major) | GC Events (minor) |
| ------------ | -------------: | ------------: | ---------------------: | ---------------------: | ----------------: | ----------------: |
| example-test |          78.85 |    1427.17733 |                 193.02 |               86.24606 |                 2 |                25 |

Notes:

  • Only write one test per file. Each test is run in an isolated child process by the test runner to make sure the performance of a given test isn't impacted by other tests.
  • Report output is valid markdown! Use it in READMEs or tther documentation.

If you want to test something without requiring in hbu and manually adding start and end calls, you make do so as shown in the ./example/injected.js example file.

Usage

For the most part, it's as simple as writing and running your tests as shown in the examples above. Note that the end function can be called inside a callback or at the end of a promise-chain for async testing. Refer to options below for additional functionality.

Options

--times

This sets the process.env.HBU_TIMES environment variable and is also available as hbu.time when requiring the hbu module into your project.

--gc-stats

Adds garbage collection statistics to the performance report.

--mode

Value of --mode can be one of: sequential (default) or parallel. Running your tests in parallel mode is much faster but may be slightly less accurate as the concurrent processes compete for CPU and memory.

--inject

When the --inject flag is included, your tests will be automatically instrumented without needing explicit calls start or end. Note that if you do have explicit calls to start or end in your code they will be ignore when this flag is used.

Note that performance metrics for tests run with the --inject flag will include load time and exit time of the file module. If you're looking to test a specific fragment of your file module, you should require hbu and manually add calls to start and end for the highest level of accuracy.

License

MIT