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

colorside

v1.2.5

Published

Colorful terminal control, amazing inputs and Random features!

Readme

ColorSide

Colorful terminal control, amazing inputs and Random features!

Install

npm install colorside@latest

Setup

import ColorSide from 'colorside';

const cs: any = new ColorSide("en"); // language if instructions: 'ru' OR 'en'
cs.use(/* class */); // Using package classes

💠 Если вы из России, по возможности купите мне поесть :) Карта: 5599002097457313

First call

import ColorSide from 'colorside';

const cs: any = new ColorSide("ru");
cs.use(cs.console) // Using class cs.console

cs.console.log("My first log!"); // like console.log

Output (cs.console)

import ColorSide from 'colorside';

const cs: any = new ColorSide("ru");
cs.use(cs.console);

cs.console.log("It's a basic log"); // Basic log like console.log
cs.console.warn("Warn??"); // Warn message with yellow text foreground
cs.console.error("Error!"); // Error message with red text foreground
cs.console.fatal("FATAL ERROR!!!") // Fatal error message with red text background and black foreground

Demo 1:

Text coloring

  • cs.fg.color() - foreground color
  • cs.fg.bright.color() - foreground bright color
  • cs.bg.color() - background color
  • cs.bg.bright.color() - background bright color
  • cs.format.style() - bold / underlined text

const cs: any = new ColorSide("ru"); cs.use(cs.console);

cs.console.log(cs.fg.bright.green(cs.format.bold("Green bright bold text"))); // likewise cs.format.underlined


## ANSI256 colors (xterm-256color)
\- colorside@^1.2.3
<br>
```ts
import { ANSI256 } from 'colorside/ansi256';

ANSI256.get.fg("#hex"); // returns only ansi256-color code. need to ANSI.reset at the end
ANSI256.get.bg("#hex"); // like get.fg, but background

ANSI256.replace.fg("#hex", "Some Text"); // returns a fg color wrapper only for text from the 2nd argument
ANSI256.replace.bg("#hex", "Some Text"); // like replace.fg, but background

Demo 2:

Clear console

import ColorSide from 'colorside';

const cs: any = new ColorSide("ru");
cs.use(cs.console);

cs.console.clear(); // clear screen

Process freezing

The application does not close spontaneously

import ColorSide from 'colorside';

const cs: any = new ColorSide("ru");
cs.use(cs.console);

cs.console.freeze();
cs.console.warn("Only Ctrl-C will kill app");

// Later, you can unfreeze the process automatically
// cs.console.unfreeze();

Sync sleep

Like setTimeout, but sync

import ColorSide from 'colorside';

const cs: any = new ColorSide("ru");
cs.use(cs.console);

cs.console.log("Downloading...");
cs.console.sleepSync(1000); // 1s
cs.console.log("Success!");

Input (cs.input)

Input prompts using inquirer API

Basic input

import ColorSide from 'colorside';

const cs: any = new ColorSide("ru");
cs.use(cs.console);
cs.use(cs.input); // Using class cs.input

async function main(): Promise<void> {
    const name = await cs.input.readline("Enter your name: "); // Basic input and nothing else
    cs.console.log(`Your name: ${cs.fg.bright.magenta(name)}`);
}

main();

Demo 3:

Advanced input (text)

import ColorSide, { ANSI } from 'colorside';
// { ANSI } import required!

const cs: any = new ColorSide("ru");
cs.use(cs.console);
cs.use(cs.input);

async function main(): Promise<void> {
    const name = await cs.input.readtext({
        message: /*(string)*/ "Enter your name:", // <- [No space after ':']
        
        /* optional params */
        // messageColor: /*(string)*/ ANSI.fg.green, - message color
        inputColor: /*(string)*/ ANSI.fg.bright.cyan, // input color
        // prefix: /*(null | string)*/ '>', - custom prefix. null = prefix disabled
        // finishPrefix: /*(boolean)*/ true, - show final prefix when input readed
        default: /*(string)*/ "John", // default name
        validate: (val) => (val.toLowerCase() !== "adolf") || "Sorry, we don't support such names" // input validation
    });
    cs.console.log(`Your name: ${cs.fg.bright.magenta(name)}`);
}

main();

Demo 4:

Advanced input (number)

import ColorSide, { ANSI } from 'colorside';
// { ANSI } import required!

const cs: any = new ColorSide("ru");
cs.use(cs.console);
cs.use(cs.input);

async function main(): Promise<void> {
    const name = await cs.input.readnumber({
        message: /*(string)*/ "Enter your name:", // <- [No space after ':']
        
        /* optional params */
        // messageColor: /*(string)*/ ANSI.fg.green, - message color
        inputColor: /*(string)*/ ANSI.fg.bright.cyan, // input color
        // prefix: /*(null | string)*/ '>', - custom prefix. null = prefix disabled
        // finishPrefix: /*(boolean)*/ true, - show final prefix when input readed
        default: /*(string)*/ "42", // default name
        validate: (val) => (Number(val > 100)) ? "Very big number!" : true // input validation
    });
    cs.console.log(`Your number: ${cs.fg.bright.magenta(name)}`);
}

main();

Demo 5:

Advanced input (list)

import ColorSide, { ANSI } from 'colorside';

const cs: any = new ColorSide("ru");
cs.use(cs.console);
cs.use(cs.input);

async function main(): Promise<void> {
    const name = await cs.input.readlist({
        message: /*(string)*/ "Select OS:",
        choices: [
            { name: 'Windows', value: 'Windows' },
            { name: 'Linux (it\'s a base)', value: 'Linux'},
            { name: 'Mac', value: 'Mac', disabled: true}
        ],
        
        /* optional params */
        // messageColor: /*(string)*/ ANSI.fg.green, - message color
        // prefix: /*(null | string)*/ '>', - custom prefix. null = prefix disabled
        // finishPrefix: /*(boolean)*/ true, - show final prefix when input readed
        // default: /*(string)*/ "value", - default name
        // validate: (val) => (condition) || else - input validation
        // instructions: (boolean) false, - hide input instructions 
        /* CUSTOM HIGHLIGHTING
        selectColors: [
            {
                keys: ["Admin"],
                color: ANSI.fg.bright.red
            }
        ],
        answerColor: "auto" / ANSI.color (string) // What will be the final color of the answer: auto - uses indexes from selectColor
        */
    });
    cs.console.log(`OS selected: ${cs.fg.bright.green(name)}`);
}

main();

Demo 6:

Advanced input (checkbox)

import ColorSide, { ANSI } from 'colorside';

const cs: any = new ColorSide("ru");
cs.use(cs.console);
cs.use(cs.input);

async function main(): Promise<void> { 
    const name = await cs.input.readcheckbox({
        message: /*(string)*/ "Select OS:",
        choices: [
            { name: 'Windows', value: 'Windows', description: 'Base user OS' },
            { name: 'Linux', value: 'Linux', description: 'Base server OS' },
            { name: 'Mac', value: 'Mac', description: 'Not OS' }
        ],
        
        /* optional params */
        // messageColor: /*(string)*/ ANSI.fg.green, - message color
        // prefix: /*(null | string)*/ '>', - custom prefix. null = prefix disabled
        // finishPrefix: /*(boolean)*/ true, - show final prefix when input readed
        // default: /*(string)*/ "value", - default name
        // validate: (val) => (condition), || else - input validation
        // instructions: (boolean) false, - hide input instructions 
        /* CUSTOM HIGHLIGHTING
        selectColors: [
            {
                keys: ["Admin"],
                color: ANSI.fg.bright.red
            }
        ] 
        */
    });
    cs.console.log(`OS selected: ${cs.fg.bright.green(name)}`);
}

main();

Demo 7:

Advanced input (password)

import ColorSide, { ANSI } from 'colorside';

const cs: any = new ColorSide("ru");
cs.use(cs.console);
cs.use(cs.input);

async function main(): Promise<void> {
    const name = await cs.input.readpassword({
        message: /*(string)*/ "Enter your pass:",
        
        /* optional params */
        // messageColor: /*(string)*/ ANSI.fg.green, - message color
        inputColor: /*(string)*/ ANSI.fg.bright.cyan, // input color
        // prefix: /*(null | string)*/ '>', - custom prefix. null = prefix disabled
        // finishPrefix: /*(boolean)*/ true, - show final prefix when input readed
        //default: /*(string)*/ - default name
        validate: (val) => (val === "ForeverHost") || "Incorrect password" // input validation
    });
    cs.console.log(`Your pass: ${cs.fg.bright.magenta(name)}`);
}

main();

Demo 8:

Advanced input (confirm)

import ColorSide, { ANSI } from 'colorside';

const cs: any = new ColorSide("ru");
cs.use(cs.console);
cs.use(cs.input);

async function main(): Promise<void> {
    const name = await cs.input.readconfirm({
        message: /*(string)*/ "Install package?",
        
        /* optional params */
        // messageColor: /*(string)*/ ANSI.fg.green, - message color
        inputColor: /*(string)*/ ANSI.fg.bright.cyan, // input color
        // prefix: /*(null | string)*/ '>', - custom prefix. null = prefix disabled
        // finishPrefix: /*(boolean)*/ true, - show final prefix when input readed
        // default: /*(string)*/ - default name
        // validate: (val) => (condition) || else - input validation
    });
    cs.console.log(`Install package: ${cs.fg.bright.magenta(name)}`);
}

main();

Demo 9:

Advanced input (toggle)

import ColorSide, { ANSI } from 'colorside';

const cs: any = new ColorSide("ru");
cs.use(cs.console);
cs.use(cs.input);

async function main(): Promise<void> {
    const name = await cs.input.readtoggle({
        message: /*(string)*/ "Install package?",
        active: "Yes",
        inactive: "No",
        /* optional params */
        // messageColor: /*(string)*/ ANSI.fg.green, - message color
        // STRING ONLY prefix: /*(string)*/ '>', - custom prefix. null = prefix disabled
        // default: /*(string)*/ - default name
        // validate: (val) => (condition) || else - input validation
        /* CUSTOM HIGHLIGHTING
        selectColors: {
            active: ANSI.color,
            inactive: ANSI.color 
        }
        answerColor: "auto" / ANSI.color (string) // What will be the final color of the answer: auto - uses indexes from selectColor
        */
        
        /** @returns true / false */
    });
    cs.console.log(`Install package: ${cs.fg.bright.magenta(name)}`);
}

main();

Demo 10:

Random module

import ColorSide, { Random, ANSI } from 'colorside';

Random.Int(1, 7); // Random int in range
Random.Float(1, 7); // Random float in range
Random.String(['A-Z', 'a-z', '0-9', /* custom symbols */ '&_₽*$+=%'], 8 /* length */); // Random string value