Détail du package

nclr

Berkmann1810MIT2.2.5

Set of pre-defined coloured console logs

CLI, colour, colors, console

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.

changelog

2.2.5 (2020-04-04)

Fix

Upgrade

  • Bump @semantic-release/changelog from 5.0.0 to 5.0.1 (1bb2fde)
  • Bump all-contributors-cli from 6.14.0 to 6.14.1 (1eda87e)
  • Bump documentation from 12.1.4 to 12.2.0 (74570b7)
  • Bump eslint-plugin-node from 11.0.0 to 11.1.0 (7dcccd1)
  • Bump jest from 25.1.0 to 25.2.0 (d55b368)
  • Bump jest from 25.2.0 to 25.2.3 (2abc6aa)
  • Bump jest from 25.2.3 to 25.2.4 (b289d96)
  • Bump jest from 25.2.4 to 25.2.6 (94c6cdf)
  • Bump lint-staged from 10.0.10 to 10.1.0 (5afe29e)
  • Bump lint-staged from 10.0.9 to 10.0.10 (bb0a6d3)
  • Bump lint-staged from 10.1.0 to 10.1.1 (dd7ec7b)
  • Bump remark-cli from 7.0.1 to 8.0.0 (7878cf4)
  • Bump remark-preset-lint-consistent from 2.0.4 to 3.0.0 (dbb9e96)
  • Bump remark-preset-lint-consistent from 2.0.4 to 3.0.0 (75ef2fc)
  • Bump remark-preset-lint-recommended from 3.0.4 to 4.0.0 (47396df)
  • Bump snyk from 1.304.0 to 1.305.0 (5aa9684)

2.2.4 (2020-03-25)

Chore

Fix

Upgrade

  • [Security] Bump acorn from 5.7.3 to 5.7.4 (884bba9)
  • [Security] Bump handlebars from 4.1.2 to 4.5.3 (ae95466)
  • [Security] Bump https-proxy-agent from 2.2.2 to 2.2.4 (d45b800)
  • [Security] Bump npm from 6.12.1 to 6.13.4 (bcd2b4b)
  • Bump @semantic-release/changelog from 3.0.4 to 3.0.5 (bbdeda6)
  • Bump @semantic-release/changelog from 3.0.5 to 3.0.6 (c26402b)
  • Bump @semantic-release/changelog from 3.0.6 to 5.0.0 (f2f65ac)
  • Bump @semantic-release/git from 7.0.16 to 7.0.17 (3d3e288)
  • Bump @semantic-release/git from 7.0.17 to 7.0.18 (9123379)
  • Bump @semantic-release/git from 8.0.0 to 9.0.0 (5235d3e)
  • Bump @semantic-release/git from 8.0.0 to 9.0.0 (#420) (4a0a8ed), closes #420
  • Bump @semantic-release/npm from 5.1.15 to 5.2.0 (3702ee5)
  • Bump @semantic-release/npm from 5.2.0 to 5.3.1 (da64838)
  • Bump @semantic-release/npm from 5.3.1 to 5.3.2 (9f76a41)
  • Bump @semantic-release/npm from 5.3.2 to 5.3.4 (c7cfe8d)
  • Bump @semantic-release/npm from 5.3.4 to 5.3.5 (01fc508)
  • Bump @semantic-release/npm from 6.0.0 to 7.0.0 (8f5e499)
  • Bump @semantic-release/npm from 6.0.0 to 7.0.0 (#419) (d2e8d33), closes #419
  • Bump @semantic-release/npm from 7.0.0 to 7.0.2 (5dc45d7)
  • Bump @semantic-release/npm from 7.0.2 to 7.0.3 (c507e03)
  • Bump @semantic-release/npm from 7.0.3 to 7.0.4 (0f9b82f)
  • Bump @semantic-release/npm from 7.0.4 to 7.0.5 (13f6313)
  • Bump all-contributors-cli from 6.10.0 to 6.11.0 (1db4976)
  • Bump all-contributors-cli from 6.11.0 to 6.11.1 (92d200e)
  • Bump all-contributors-cli from 6.11.1 to 6.11.2 (85e43a0)
  • Bump all-contributors-cli from 6.11.2 to 6.12.0 (d0b3c70)
  • Bump all-contributors-cli from 6.12.0 to 6.13.0 (f1f29a5)
  • Bump all-contributors-cli from 6.13.0 to 6.14.0 (58ac221)
  • Bump all-contributors-cli from 6.8.1 to 6.8.2 (62df28a)
  • Bump all-contributors-cli from 6.8.2 to 6.9.0 (a8ebcc9)
  • Bump all-contributors-cli from 6.9.0 to 6.9.1 (b5de367)
  • Bump all-contributors-cli from 6.9.1 to 6.9.3 (6e5c95f)
  • Bump all-contributors-cli from 6.9.3 to 6.10.0 (93d598a)
  • Bump colors from 1.3.3 to 1.4.0 (14c09c4)
  • Bump conventional-changelog-eslint from 3.0.1 to 3.0.4 (e72b26f)
  • Bump documentation from 12.1.1 to 12.1.2 (93b6c38)
  • Bump documentation from 12.1.2 to 12.1.3 (49fda51)
  • Bump documentation from 12.1.3 to 12.1.4 (003c61d)
  • Bump eslint from 6.2.2 to 6.3.0 (ed42199)
  • Bump eslint from 6.3.0 to 6.4.0 (5a4784b)
  • Bump eslint from 6.4.0 to 6.5.1 (c48283f)
  • Bump eslint from 6.5.1 to 6.6.0 (3508a3d)
  • Bump eslint from 6.6.0 to 6.7.1 (87e8e4d)
  • Bump eslint from 6.7.1 to 6.7.2 (5976673)
  • Bump eslint from 6.7.2 to 6.8.0 (188f8eb)
  • Bump eslint-plugin-node from 10.0.0 to 11.0.0 (cc645dc)
  • Bump eslint-plugin-node from 9.1.0 to 9.2.0 (771fa58)
  • Bump eslint-plugin-node from 9.2.0 to 10.0.0 (af6be0a)
  • Bump eslint-plugin-node from 9.2.0 to 10.0.0 (#280) (95d5bab), closes #280
  • Bump eslint-plugin-you-dont-need-lodash-underscore (8e39132)
  • Bump eslint-plugin-you-dont-need-lodash-underscore (976bdf7)
  • Bump eslint-plugin-you-dont-need-lodash-underscore (ffcc0ea)
  • Bump eslint-plugin-you-dont-need-lodash-underscore (d91d861)
  • Bump eslint-plugin-you-dont-need-lodash-underscore (5f679e6)
  • Bump eslint-plugin-you-dont-need-lodash-underscore (47e0138)
  • Bump figures from 3.0.0 to 3.1.0 (a92d882)
  • Bump figures from 3.1.0 to 3.2.0 (7fc1389)
  • Bump handlebars from 4.1.2 to 4.5.3 (f90242e)
  • Bump husky from 3.0.4 to 3.0.5 (688ebb6)
  • Bump husky from 3.0.5 to 3.0.7 (65283f5)
  • Bump husky from 3.0.7 to 3.0.8 (a24ac88)
  • Bump husky from 3.0.8 to 3.0.9 (dfda551)
  • Bump husky from 3.0.9 to 3.1.0 (2e4b529)
  • Bump husky from 3.1.0 to 4.0.0 (6f3d8bf)
  • Bump husky from 4.0.0 to 4.0.1 (577f73a)
  • Bump husky from 4.0.1 to 4.0.3 (27baf6d)
  • Bump husky from 4.0.10 to 4.2.0 (4987235)
  • Bump husky from 4.0.3 to 4.0.5 (0c066c3)
  • Bump husky from 4.0.5 to 4.0.7 (ae91276)
  • Bump husky from 4.0.7 to 4.0.9 (d79e727)
  • Bump husky from 4.0.9 to 4.0.10 (fb49314)
  • Bump husky from 4.2.0 to 4.2.1 (07a3d33)
  • Bump husky from 4.2.1 to 4.2.2 (924c31b)
  • Bump husky from 4.2.2 to 4.2.3 (bcf8cff)
  • Bump jest from 24.9.0 to 25.1.0 (0a27a9f)
  • Bump jest from 24.9.0 to 25.1.0 (#409) (1894157), closes #409
  • Bump lint-staged from 10.0.0 to 10.0.1 (802b0b6)
  • Bump lint-staged from 10.0.1 to 10.0.2 (0e52b72)
  • Bump lint-staged from 10.0.2 to 10.0.3 (9f9c7ee)
  • Bump lint-staged from 10.0.3 to 10.0.4 (3da24ad)
  • Bump lint-staged from 10.0.4 to 10.0.6 (edca134)
  • Bump lint-staged from 10.0.6 to 10.0.7 (5986ed4)
  • Bump lint-staged from 10.0.7 to 10.0.8 (f7a9641)
  • Bump lint-staged from 10.0.8 to 10.0.9 (a8a9e69)
  • Bump lint-staged from 9.2.4 to 9.2.5 (2cbf8d7)
  • Bump lint-staged from 9.2.5 to 9.3.0 (90b2c4f)
  • Bump lint-staged from 9.3.0 to 9.4.0 (9337c15)
  • Bump lint-staged from 9.4.0 to 9.4.1 (02cc0af)
  • Bump lint-staged from 9.4.1 to 9.4.2 (c9207f3)
  • Bump lint-staged from 9.4.2 to 9.4.3 (b41f910)
  • Bump lint-staged from 9.4.3 to 9.5.0 (d30896f)
  • Bump lint-staged from 9.5.0 to 10.0.0 (197e2bf)
  • Bump lint-staged from 9.5.0 to 10.0.0 (#406) (d296fc1), closes #406
  • Bump prettier from 1.18.2 to 1.19.1 (b9211e9)
  • Bump remark-cli from 7.0.0 to 7.0.1 (3249e9b)
  • Bump remark-preset-lint-consistent from 2.0.3 to 2.0.4 (bbf5e37)
  • Bump remark-preset-lint-recommended from 3.0.3 to 3.0.4 (3dc6ee3)
  • Bump semantic-release from 15.13.24 to 15.13.27 (f01000c)
  • Bump semantic-release from 15.13.27 to 15.13.28 (98bc828)
  • Bump semantic-release from 15.13.28 to 15.13.30 (b05ea87)
  • Bump semantic-release from 15.13.30 to 15.13.31 (a74a7cc)
  • Bump semantic-release from 15.13.31 to 15.14.0 (cf8bfa5)
  • Bump semantic-release from 16.0.0 to 16.0.1 (ccd6c02)
  • Bump semantic-release from 16.0.1 to 16.0.2 (0b1e738)
  • Bump semantic-release from 16.0.2 to 16.0.3 (3e8c7ac)
  • Bump semantic-release from 16.0.3 to 16.0.4 (462b843)
  • Bump semantic-release from 16.0.4 to 17.0.2 (85c013b)
  • Bump semantic-release from 17.0.2 to 17.0.3 (d832600)
  • Bump semantic-release from 17.0.3 to 17.0.4 (eb8afdb)
  • Bump semantic-release, @semantic-release/git and @seman… (#397) (f19c0c4), closes #397
  • Bump semantic-release, @semantic-release/git and @semantic-release/npm (e1025ae)
  • Bump snyk from 1.219.0 to 1.220.0 (1964bff)
  • Bump snyk from 1.220.0 to 1.221.1 (fafeee9)
  • Bump snyk from 1.221.1 to 1.222.1 (8e08da2)
  • Bump snyk from 1.222.1 to 1.223.0 (53d8c65)
  • Bump snyk from 1.223.0 to 1.224.0 (a1fab1c)
  • Bump snyk from 1.224.0 to 1.226.0 (09126f8)
  • Bump snyk from 1.226.0 to 1.226.1 (88d7653)
  • Bump snyk from 1.226.1 to 1.226.2 (e3ca076)
  • Bump snyk from 1.226.2 to 1.227.0 (e211bb8)
  • Bump snyk from 1.227.0 to 1.228.0 (88918e1)
  • Bump snyk from 1.228.0 to 1.228.2 (5269c53)
  • Bump snyk from 1.228.2 to 1.228.3 (c2e6b32)
  • Bump snyk from 1.228.3 to 1.228.5 (380f186)
  • Bump snyk from 1.228.5 to 1.230.0 (013bce4)
  • Bump snyk from 1.230.0 to 1.230.2 (a3eafcd)
  • Bump snyk from 1.230.2 to 1.230.5 (32c122b)
  • Bump snyk from 1.230.5 to 1.231.0 (2ff9e28)
  • Bump snyk from 1.231.0 to 1.232.0 (c38a7f5)
  • Bump snyk from 1.232.0 to 1.234.0 (7072661)
  • Bump snyk from 1.234.0 to 1.234.2 (783efa7)
  • Bump snyk from 1.234.2 to 1.235.0 (667a144)
  • Bump snyk from 1.235.0 to 1.235.1 (9496c66)
  • Bump snyk from 1.235.1 to 1.236.1 (6dfe8f3)
  • Bump snyk from 1.236.1 to 1.237.1 (a987f08)
  • Bump snyk from 1.237.1 to 1.238.0 (eb65c57)
  • Bump snyk from 1.238.0 to 1.239.0 (e1d2427)
  • Bump snyk from 1.239.0 to 1.239.3 (c0b6dce)
  • Bump snyk from 1.239.3 to 1.239.5 (013b6f7)
  • Bump snyk from 1.239.5 to 1.240.1 (3d17d81)
  • Bump snyk from 1.240.1 to 1.241.0 (92de7cf)
  • Bump snyk from 1.241.0 to 1.242.0 (3998475)
  • Bump snyk from 1.242.0 to 1.243.0 (f90254b)
  • Bump snyk from 1.243.0 to 1.244.0 (623b2a0)
  • Bump snyk from 1.244.0 to 1.245.0 (77185b6)
  • Bump snyk from 1.245.0 to 1.247.1 (6656ce4)
  • Bump snyk from 1.247.1 to 1.248.0 (ad6f736)
  • Bump snyk from 1.248.0 to 1.249.1 (4b954d9)
  • Bump snyk from 1.249.1 to 1.250.0 (f400c2b)
  • Bump snyk from 1.250.0 to 1.251.0 (2d096c8)
  • Bump snyk from 1.251.0 to 1.251.1 (ba3d83d)
  • Bump snyk from 1.251.1 to 1.251.2 (71f7d18)
  • Bump snyk from 1.251.2 to 1.252.0 (8e1a362)
  • Bump snyk from 1.252.0 to 1.253.0 (ff20aaa)
  • Bump snyk from 1.253.0 to 1.254.0 (d350fbc)
  • Bump snyk from 1.254.0 to 1.256.0 (b474cc5)
  • Bump snyk from 1.256.0 to 1.258.1 (b0855b2)
  • Bump snyk from 1.258.1 to 1.258.2 (e7d72cf)
  • Bump snyk from 1.258.2 to 1.259.0 (a54a238)
  • Bump snyk from 1.259.0 to 1.260.0 (bf94077)
  • Bump snyk from 1.260.0 to 1.261.0 (fd6a340)
  • Bump snyk from 1.261.0 to 1.262.0 (3381710)
  • Bump snyk from 1.262.0 to 1.263.0 (a971606)
  • Bump snyk from 1.263.0 to 1.264.0 (a23ad32)
  • Bump snyk from 1.264.0 to 1.265.0 (e897e0e)
  • Bump snyk from 1.265.0 to 1.266.0 (f9da96b)
  • Bump snyk from 1.266.0 to 1.267.0 (414dbc2)
  • Bump snyk from 1.267.0 to 1.269.0 (c64e340)
  • Bump snyk from 1.269.0 to 1.271.0 (ca6b974)
  • Bump snyk from 1.271.0 to 1.274.0 (28ed2ad)
  • Bump snyk from 1.274.0 to 1.277.0 (0a38331)
  • Bump snyk from 1.277.0 to 1.277.2 (16743b9)
  • Bump snyk from 1.277.2 to 1.277.3 (a316d3d)
  • Bump snyk from 1.277.3 to 1.278.1 (c0ea9ae)
  • Bump snyk from 1.278.1 to 1.279.0 (d7e357f)
  • Bump snyk from 1.279.0 to 1.279.1 (1f86317)
  • Bump snyk from 1.279.1 to 1.280.1 (34cf20d)
  • Bump snyk from 1.280.1 to 1.283.0 (9adebe5)
  • Bump snyk from 1.283.0 to 1.286.1 (265994e)
  • Bump snyk from 1.286.1 to 1.288.0 (15df042)
  • Bump snyk from 1.288.0 to 1.290.1 (2c6bab0)
  • Bump snyk from 1.290.1 to 1.290.2 (087d878)
  • Bump snyk from 1.290.2 to 1.291.0 (42626df)
  • Bump snyk from 1.291.0 to 1.292.0 (51fdec5)
  • Bump snyk from 1.292.0 to 1.294.0 (32f3fb1)
  • Bump snyk from 1.294.0 to 1.294.1 (70cc008)
  • Bump snyk from 1.294.1 to 1.296.0 (75411bb)
  • Bump snyk from 1.296.0 to 1.296.1 (6430a4b)
  • Bump snyk from 1.296.1 to 1.297.1 (b4dc38d)
  • Bump snyk from 1.297.1 to 1.297.2 (da36409)
  • Bump snyk from 1.297.2 to 1.297.3 (07c70fd)
  • Bump snyk from 1.297.3 to 1.297.4 (1f164e7)
  • Bump snyk from 1.297.4 to 1.298.0 (3fdccd2)
  • Bump snyk from 1.298.0 to 1.298.1 (093179e)
  • Bump snyk from 1.298.1 to 1.299.0 (4513b28)
  • Bump snyk from 1.299.0 to 1.300.0 (13e689d)
  • Bump snyk from 1.300.0 to 1.303.0 (50e3130)
  • Bump snyk from 1.303.0 to 1.303.1 (23816e0)
  • Bump snyk from 1.303.1 to 1.304.0 (21523f3)

2.2.3 (2019-08-26)

Build

Chore

Fix

Upgrade

2.2.2 (2019-04-16)

Fix

Upgrade

2.2.1 (2019-04-15)

Fix

2.2.0 (2019-04-14)

Build

Chore

Docs

New

Upgrade

2.1.0 (2019-01-08)

2.0.0 (2018-12-31)

Update

  • Replaced log-symbols with figures (97ecfa3), closes #20

BREAKING CHANGES

  • info, error, warning and question outputs differently.

1.3.0 (2018-12-11)

Build

Docs

New

Upgrade

1.2.1 (2018-11-12)

Fix

Upgrade

1.2.0 (2018-11-02)

Build

Docs

New

Update

1.1.0 (2018-10-30)

New

1.0.1 (2018-10-25)

Docs

1.0.1-0 (2018-10-23)

1.0.0 (2018-10-23)

Docs

Update