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

cli-styler.js

v1.0.0

Published

Style your terminal.

Readme

cli-styler.js

cli-styler.js is a Node.js library that provides functions for styling text and background colors in the terminal.

Installation

Install cli-styler.js using npm:

npm i cli-styler.js
const cli = require("cli-styler.js");

cli.style({ color: "butter", text: "Hello Dunia!" });
cli.styleR("<bold color: #ba22b1>Hello masbro!");
cli.styleP().bold.ul.green.text("Hello ... World");

"styleR" function

/*
// Explanations and Examples

// set style text
<bold> or <b>           // set style text to bold
<blink>                 // set style text to blink
<underline> or <ul>     // set style text to underline
<italic> or <i>         // set style text to italic
<inverse>               // set style text to inverse
<dim>                   // set style text to dim
<strike>                // set style text to strikethrough

// set color, background color, and line without style text
<?color: red>               // set color to red
<?color: red&bg: banana>    // set color to red and set background color to banana
<?bg: banana&color: red>    // set background color to banana and set color to red
<?bg: (0,200,200)>          // set background color with (r, g, b)
<?bg: #90278a>              // set background color with hexadecimal
<?color: (200,200,0)>       // set color with (r, g, b)
<?color: #d105c1>           // set color with hexadecimal
<?line: (1, 10)>            // set position line to (x = 1, y = 10) or (columns = 1, rows = 10)

// set style text, color, background color, and line
<bold color: cyan>          // set style text to bold and set color to cyan

// reset
<@reset>                              // reset all style to default
<@reset-color>                        // reset color to default
<@reset-background> or <@reset-bg>    // reset background color to default
<@reset-styleText> or <@reset-st>     // reset style text bold, underline, blink, dim, inverse, hide, strikethrough

<@reset-bold> or <@reset-b>           // reset style text bold
<@reset-underline> or <@reset-ul>     // reset style text underline
<@reset-italic> or <@reset-i>         // reset style text italic
<@reset-blink>                        // reset style text blink
<@reset-inverse>                      // reset style text inverse
<@reset-hide>                         // reset style text hide
<@reset-strike>                       // reset style text strikethrough

// NOTE: <@reset-dim> and <@reset-b> will reset that same things (dim, bold)
<@reset-dim>                          // reset style text dim and bold
<@reset-dimb>                         // reset style text dim and set style text to bold

// undo style text, color, background color
<@undo-color>                       // undo color - 1 into previous color that you set
<@undo-bg>                          // undo background color - 1 into previous color that you set
<@undo-st>                          // undo style text - 1 into previous color that you set
*/

const cli = require("cli-styler.js");

// return string
cli.styleR("<bold color: green><inverse>Hello, World!<@reset>");

"styleP" function

const cli = require("cli-styler.js");

// return string
cli.styleP().bold.banana.text("Hello world");
cli.styleP().bold.banana.text("Hello world", "2024");
cli.styleP().bold.banana.bgGreen.text("Hello world");
cli.styleP().textR("<inverse color:red>lol");

"style" function

const cli = require("cli-styler.js");

/*
// Explanation and Example

// set text
cli.style({text: "hello, world"})  // set text to "hello, world"
cli.style({text: ["foo", "bar"]})  // set text to "foo bar"

// set style text
cli.style({text: "foo", st: "ul"})               // set text to "foo" and style text to underline
cli.style({text: "foo", st: ["ul", "b"]})        // set text to "foo" and style text to underline and bold
cli.style({text: "foo", styleText: "ul"})        // set text to "foo" and style text to underline
cli.style({text: "foo", styleText: ["ul", "b"]}) // set text to "foo" and style text to underline and bold

// set color
cli.style({text: "foo", color: "red"})         // set text to "foo" and color to red
cli.style({text: "foo", color: [0, 200, 200]}) // set text to "foo" and color to (r, g, b)
cli.style({text: "foo", color: "#13d105"})     // set text to "foo" and color to "hexadecimal"

// set background color
// bg or background
cli.style({text: "foo", bg: "red"})         // set text to "foo" and background color to red
cli.style({text: "foo", bg: [250, 0, 200]}) // set text to "foo" and background color to (r, g, b)
cli.style({text: "foo", bg: "#d10505"})     // set text to "foo" and background color to "hexadecimal"

// set line if text is Array
// line or ln
cli.style({text: ["foo", "bar"], line: "inline"}) // set text to "foo" "bar" and "foo bar" 
cli.style({text: ["foo", "bar"], line: "nline"})  // set text to "foo" "bar" and "foo\nbar"
*/

See all colors can you chose.

License

This project is licensed under the ISC License - see the LICENSE file for details.