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

nclr

v2.2.5

Published

Set of pre-defined coloured console logs

Downloads

12

Readme

nclr

NPM

GitHub package version devDependencies Status dependencies Status

GH Downloads GitHub commit activity the past year GitHub contributors Github search hit counter

Build Status codecov.io Code Coverage tested with jest Known Vulnerabilities

GitHub contributions welcome Commitizen friendly

GitHub top language GitHub language count GitHub code size in bytes

BCH compliance Codacy Badge

Mini NPM package with coloured log functions and more.

Contributions

Please refer to the contribution guideline.

Contributors

| Maximilian Berkmann🐛 💻 📖 🤔 💬 👀 🛡️ ⚠️ | Dependabot🔧 | Semantic Release Bot📖 📦 | Codacy Badger📖 | | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |

Documentation

Table of Contents

index

Set of functions for coloured logs.

Parameters

  • data ...any

error

  • See: log

Print an error.

Parameters

  • data ...any Data to print

Examples

error('Something wrong happened with', new Error(this));

Returns boolean Did it happened?

info

  • See: log

Print an information.

Parameters

  • data ...any Data to print

Examples

info('Welcome John');

Returns boolean Did it happened?

dbg

  • See: log

Print a debug message.

Parameters

  • data ...any Data to print

Examples

dbg('i=', i);

Returns boolean Did it happened?

out

  • See: log

Print an output.

Parameters

  • data ...any Data to print

Examples

out(`1 + 1 = ${rpc('1 1 +')}`);

Returns boolean Did it happened?

inp

  • See: log

Print an input.

Parameters

  • data ...any Data to print

Examples

inp(name);

Returns boolean Did it happened?

warn

  • See: log

Print a warning.

Parameters

  • data ...any Data to print

Examples

warn('The following function is deprecated');

Returns boolean Did it happened?

quest

  • See: log

Print a question.

Parameters

  • data ...any Data to print

Examples

quest('What is your username?');

Returns boolean Did it happened?

succ

  • See: log

Print a success log.

Parameters

  • data ...any Data to print

Examples

succ('Achievement unlocked');

Returns boolean Did it happened?

extend

Extend the current theme.

Parameters

Examples

Using extensions as methods:

const nclr = require('nclr');
nclr.extend({
  suc: ['green', 'underline'],
  data: 'magenta'
});
nclr.suc('Yay!');
nclr.data(42);

Using extensions as functions:

const nclr = require('nclr');
nclr.extend({
  suc: ['green', 'underline'],
  data: 'magenta'
});
const { suc, data } = nclr;
suc('Yay!');
data(42);
  • Throws Error Invalid extension key

clr

CLI colours.

clr

Colour/style theme for the CLI.

Type: {inp: string, out: Array<string>, info: string, error: string, warn: string, dbg: string, quest: string}

lib

Set of library functions for nclr.

log

STDOUT log.

Parameters

  • data any Data to print

Examples

log('Lorem ipsum dolore sit amet');

Returns boolean Did it happened?

use

Colourise something.

Parameters

  • name string Name of the log in the theme
  • data ...any Data

Examples

let information = use('info', 'Some info styled text');

Nesting

log('Something', use('warn', 'really ', use('info', 'cool!')));
  • Throws Error Invalid name

Returns string Coloured output

restoreTheme

Restore the default fields of the theme.