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

@ialopezg/cli

v1.0.3

Published

CLI tools for Node.js

Downloads

5

Readme

Build Status Coverage Status All Contributors

Custom Colors and Formats to be used in NodeJS or in a Terminal console.

Technology Stack

VS Code Shell Git GitHub Node.JS TypeScript JavaScript

Features

  • Compatible with both TypeScript and ES6 (I recommend to use TypeScript)
  • Zero dependencies

Getting started

Requirements

  • npm v6+ or yarn v1.17+
  • NodeJS v8+

Installation

You have two options to install this repository.

  1. By adding the dependency to your package.json file.

    {
      "dependencies": {
        "custom-console-colors": "^0.0.4"
      }
    }
    # Install dependencies
    # NPM
    npm install
    # or Yarn
    yarn
  2. By using a package manager

    # NPM
    npm install --save custom-console-color
    # or Yarn
    yarn add @ialopezg/core

Usage

Usage

const { Color } = require('custom-console-color')

Colored text

console.log(Color.red('Red color text'));

Mixed styles

console.log(Color.red().bold('Red color text with bold style'))

Styled text with unstyled text

console.log(`${Color.red('Red color')} text with ${Color.bold('unstyled')} text`)

Predefining colors

const error = Color.red;
const log = Color.green;
const notice = Color.blue;
const warn = Color.yellow;

console.log(error('Error!'));
console.log(log('Log!'));
console.log(notice('Notice!'));
console.log(warn('Warning!'));

Another awesome example

const appStarted = (host, port, proxy) => {
  const divider = Color.green('\n-----------------------------------')
  const ip = '127.0.0.1';

  console.log(`Server started! ${Color.green('✓')}`)
  if (proxy) {
    console.log(`Proxy initialized! ${Color.green('✓')}`)
  }

  console.log(`
${Color.bold('Access URLs:')}${divider}
Localhost: ${Color.magenta(`http://${host}:${port}`)}
      LAN: ${Color.magenta(`http://${ip}:${port}`) +
    (proxy ? `\n    Proxy: ${Color.magenta(proxy)}` : '')}${divider}
${Color.blue(`Press ${Color.italic('CTRL-C')} to stop`)}
    `)
};

appStarted('localhost', 3000, '192.168.0.255');

Available Colors and Styles

Styles

  • bold
  • dim
  • italic
  • underline
  • blink
  • inverse
  • hidden
  • strike

Foreground colors

| Normal (ANSI) | Bright (Extended) | | ------------- | ----------------- | | black | brightBlack | | red | brightRed | | green | brightGreen | | yellow | brightYellow | | blue | brightBlue | | magenta | brightMagenta | | cyan | brightCyan| | white | brightWhite |

Background colors

| Normal (ANSI) | Bright (Extended) | | --- | --- | | bgBlack | bgBrightBlack | | bgRed | bgBrightRed | | bgGreen | bgBrightGreen | | bgYellow | bgBrightYellow | | bgBlue | bgBrightBlue | | bgMagenta | bgBrightMagenta | | bgCyan | bgBrightCyan | | bgWhite | bgBrightWhite |

People

Author - Isidro A. Lopez G.

License

CustomConsoleColors is licensed under MIT license.


© Copyright 2019-present - CustomConsoleColors by Isidro A. López G.