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

brews-toolboxjs

v1.0.19

Published

Tools for your js

Readme

Brew's Toolbox.js

This little toolbox has reusable code for different projects. No, they aren't yet highly developed or efficient algorithms but I like them anyhow. This is mostly for me to add code to other projects but it's obviously available for anyone to copy and use.

capitalizeWords()

Takes in a word or words and returns them capitalized. For example:

capitalizeWords("good morning") => Good Morning

compareAlphabetical() / sortAlphabetical()

The compare function takes in two values and attempts to sort them alphabetically.

compareAlphabetical("alpha", "beta") => 1 compareAlphabetical("beta", "alpha") => -1 compareAlphabetical("beta", "beta") => 0

The sort function takes in an array and attempts to return a new alphabetized array. For example:

sortAlphabetical(["alpha", "gamma", "beta"]) => ["alpha", "beta", "gamma"]

This sort function is non-destructive.

isALetter() / isAConsonant() / isAVowel()

A few simple ones that return true or false if a single string character is a letter, consonant, or vowel. For example:

isALetter("a") => true

isAConsonant("a") => false

isAConsonant("b") => true

isAVowel("a") => true

isAVowel("b") => false

numWord()

This takes in a positive integer and spits out the corresponding word. For example:

numWord(1) => "one"

nthNumWord()

Similar to numWord(), nthNumWord() takes in a positive integer and spits out the word in its nth form, for example:

nthNumWord(10) => "tenth"

random()

Takes in an array, an object or string and returns a random element from it. For example:

random([1, 2, 3, 4, 5]) => 2

random({1: "a", 2: "b", 3: "c", 4: "d", 5: "e"}) => {3: "c"}

random("panda") => "n"

Many of these functions have been built to render error messages on the console if an incorrect argument gets passed in, however they won't throw errors themselves.

stringToColor()

Takes in an argument of a string and converts that string to a hexadecimal color code. For example:

stringToColor('I am a string') => "#cd14fb"

toBinary()

Takes an argument of an integer and converts that integer into a string of binary. For example:

toBinary(5) => "101"

fromBinary()

Takes an argument of a string representing binary and converts that to an integer. For example:

fromBinary("101") => 5

npm

I've added this as an npm package just for the fun of it. It can be added to a project by running:

$ npm install brews-toolboxjs

Once added, import functions to your local file like so:

import {random, isALetter, sortAlphabetical} from 'brews-toolboxjs'

You can also import the entire toolbox for use:

import toolbox from 'brews-toolboxjs'

toolbox.isALetter("a") => true

Version

1.0.18