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

colorfast

v1.0.0

Published

Tool which helps developers to manage color schemas in projects by gathering and representing all colors in project files.

Downloads

4

Readme

According to LEXICO colorfast is:

Dyed in colors that will not fade or be washed out.

In fact, this tool will help developers to vanish all extra colors in a project which supposed to be the same as color schema, but went uncontrollable during development. Once I saw a project which had clear and strict color schema of about 16 colors, but it turned out that project files contain over 200 variations of origin schema. This is why Colorfast was made.

colorfast

Installation

npm install --save-dev colorfast

Usage

CLI

npx colorfast --input ./path/to/styles/directory --scheme ./path/to/sass/variables --report ./path/where/to/save/report

API

Gather colors info

Default function is gathering colors info from the given styles path and returns ColorMap

import colorfast from "colorfast";

const colorMap = colorfast(stylesDirPath, pathToSassVariables);

Helpers and algorithms

  1. Sorting colors

Simple insertion sort is using for sorting array of colors by their index (hex value).

import { insertionSortForColors } from "colorfast";

const unsortedColors = ["#fff", "rgb(0, 0, 0)", "#336699"];
const sortedColors = insertionSortForColors(unsortedColors); // ["rgb(0, 0, 0)", "#336699", "#fff"]
  1. Color helpers

Range of helpers for converting different color format to HEX and get color index.

import { convertRGBtoHEX, getColorIndex, getHEXValue, fullHEX } from "colorfast";

convertRGBtoHEX("rgb(0, 0, 0)"); // "#000"
convertRGBtoHEX("rgba(0, 0, 0, 0.5)"); // "#000"
convertRGBtoHEX("rgba(0, 0, 0, 0.5, 0)"); // ""

getColorIndex("rgb(255, 255, 255)"); // 16777215
getColorIndex("#000"); // 0

getHEXValue("#fff"); // 16777215

fullHEX("#fff"); // #ffffff
fullHEX("#369"); // #336699