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 🙏

© 2024 – Pkg Stats / Ryan Hefner

eight-colors

v1.3.0

Published

Eight colors for the console

Downloads

376,285

Readme

Eight Colors

Eight colors for the console

Install

npm i eight-colors

Features

  • Eight Colors: black, red, green, yellow, blue, magenta, cyan, white
  • Background and Bright
  • Styles: reset, bold, faint, italic, underline, inverse, hidden, strike
  • Remove colors
  • Log colors

Usage

const EC = require("eight-colors");

// text color
console.log(EC.red('red string'));

// background color
console.log(EC.bg.red('red background'));

// bright color
console.log(EC.br.red('bright red string'));

// bright background color
console.log(EC.br.bg.red('bright red background'));

// style
console.log(EC.italic('italic text'));
console.log(EC.underline('underline text'));
console.log(EC.green(EC.underline('green underline text')));

// remove color
const redString = EC.red('red string');
console.log(redString);
const string = EC.remove(redString);
console.assert(string === 'red string');

// log color
const res = EC.logRed('string1', 'string2');
console.assert(EC.remove(res) === 'string1 string2');

EC.logGreen('log green');
EC.logRed('log red');
EC.logCyan('log cyan');
EC.logBlack('log black');
EC.logWhite('log white');

EC.log('log 2 arguments', '2');
EC.logGreen('logGreen 2 arguments', '2');
EC.logMagenta('logMagenta 3 arguments', '2', '3');

// disabled color
EC.disabled = true;
EC.logRed('disabled = true log default');
EC.disabled = false;
EC.logRed('disabled = false log red');

APIs

EC.black(str)
EC.red(str)
EC.green(str)
EC.yellow(str)
EC.blue(str)
EC.magenta(str)
EC.cyan(str)
EC.white(str)

EC.bg.black(str)
EC.bg.red(str)
EC.bg.green(str)
EC.bg.yellow(str)
EC.bg.blue(str)
EC.bg.magenta(str)
EC.bg.cyan(str)
EC.bg.white(str)

EC.br.black(str)
EC.br.red(str)
EC.br.green(str)
EC.br.yellow(str)
EC.br.blue(str)
EC.br.magenta(str)
EC.br.cyan(str)
EC.br.white(str)

EC.br.bg.black(str)
EC.br.bg.red(str)
EC.br.bg.green(str)
EC.br.bg.yellow(str)
EC.br.bg.blue(str)
EC.br.bg.magenta(str)
EC.br.bg.cyan(str)
EC.br.bg.white(str)

EC.reset(str)
EC.bold(str)
EC.faint(str)
EC.italic(str)
EC.underline(str)
EC.inverse(str)
EC.hidden(str)
EC.strike(str)

EC.remove(str)

EC.log(str)
EC.logBlack(str)
EC.logRed(str)
EC.logGreen(str)
EC.logYellow(str)
EC.logBlue(str)
EC.logMagenta(str)
EC.logCyan(str)
EC.logWhite(str)

EC.disabled = true|false

Browser Console

Usage is the same as above, and provides an additional UMD bundle (1.35 KB)

<script src="path-to/eight-colors/dist/eight-colors.js"></script>
<script>
    const EC = window['eight-colors'];
    console.log(EC.red('red string'));
</script>

  • firefox does not support

Links

CHANGELOG

  • 1.3.0

    • added disabled property, defaults to false
  • 1.2.1

    • fixed types for commonjs
  • 1.2.0

    • remove useless logColor
  • 1.1.1

    • fixed types
  • 1.1.0

    • added types
  • 1.0.3

    • fixed API multiple arguments
  • 1.0.2

    • added browser bundle
  • 1.0.1

    • added log color API
  • 1.0.0