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

test-builder

v1.2.1

Published

A package used to create tests in node.js, and evaluate them.

Readme

Test-Builder

A node.js library made to test the latest build of your amazing APIs.

This library is made to be as simple as possible, to get your tests completed in style. To do this, Test-Build has built in styles using chalk template litterals such as green.bold.underline. You can read more about those types of litterals on chalk's npm readme. Note: those literals have minor changes. Hex:

`bgHex(#FFFF)` // The hex color #FFFF as the background.

`hex(#FFFF)` // The hex color #FFFF as the text color.

Rgb:

`bgRgb(255, 255, 255)` // Black in RGB as the background

`rgb(#FFFF)` // Black in RGB as the text color.

These chain the same way:

`underline.rgb(1,2,3).bold`

Getting Started:

Instalation:

npm install test-builder

Setup

Creating an instance:

/*
Import the required class to make a test.

Test class is the constructor to create test instances.
*/
const { Test } = require('test-builder'); 


/*
Import the api or to test using test-builder.
*/
const someAPI = require('path/to/some/api');

let ApiTest = new Test(
    'someAPI', // Sets the name of the test, shown in the first scope label.
    true, // Determines if values are shown in the detail.
    theme // The theme configuration determining the layout of the output. See 'Themes'.
);

ApiTest.test(
    true, // Detail, same as in the Test class, but overrides the parent.
    'Random-Emoji', // Name of the sub-test displayed in the second scope.
    'A random emoji api.' // The description displayed after 'failure' or 'success' in the console.
).notEqual( // Function to test if two or more values are not all the same.
    someAPI.randomEmote(), // Get random emote from some api.
    someAPI.randomEmote() // Get another random emote.
);
/*
The test would have tested if the emotes are random, which means there is only a small test of being equal.
*/

ApiTest.test(
    true, // Detail, same as in the Test class, but overrides the parent.
    'Alphabet', // Name of the sub-test displayed in the second scope.
    'Get first letter of alphabet.' // The description displayed after 'failure' or 'success' in the console.
).equals( // Function to test if two or more values are equivelent.

    someAPI.nthOfAlphabet(1), // Get 1st letter of the alphabet, in this example it is supposed to be 1 for first.
    'a' // First letter of the alphabet

);
/*
In this example, 'someAPI.nthOfAlphabet' was 0-based instead of starting at one, causing it to fail the test.
*/

The above code would yield a result simmilar to the one below, results may differ for theme and api.

Test Functions

const { Test } = require('test-builder');
let test = new Test().test(); // The test instance with the test functions.


/*
Tests if all values supplied in the arguments are equivelent.
*/
test.equals(value[,value...])


/*
Tests if the arguments supplied are not all the same.
*/
test.notEqual(value[,value...])


/*
Tests if all values supplied in the arguments are of the same type.
(from `typeof value`)
*/
test.sameType(value[,value...])


/*
Tests if the types of the values in the arguments are not all equivelent.
(from `typeof value`)
*/
test.notEqual(value[,value...])

Themes

Remember the theme option in the constructor? Well the following is how to get additional themes.

let { themes } = require('test-builder');

themes.default // The default theme

themes.halloween // A halloween theme, bats and candy.

More themes?

Make a theme using the structure of the default theme? Want to share it in production? Make a pull request on the github repo adding your theme to src/theme and it may go into production!