开发者社区> 镜像站> NPM> triple-beam
triple-beam
Definitions of levels for logging purposes & shareable Symbol constants.
Last updated 3 years ago by indexzero .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install triple-beam 
SYNC missed versions from official npm registry.

triple-beam

Definitions of levels for logging purposes & shareable Symbol constants.

Usage

const { LEVEL } = require('triple-beam');
const colors = require('colors/safe');

const info = {
  [LEVEL]: 'error',
  level: 'error',
  message: 'hey a logging message!'
};

// Colorize your log level!
info.level = colors.green(info.level);

// And still have an unmutated copy of your level!
console.log(info.level === 'error');  // false
console.log(info[LEVEL] === 'error'); // true

Tests

Tests are written with mocha, assume, and nyc. They can be run with npm:

npm test
LICENSE: MIT
AUTHOR: Charlie Robbins

Current Tags

  • 1.3.0                                ...           latest (3 years ago)

5 Versions

  • 1.3.0                                ...           3 years ago
  • 1.2.0                                ...           3 years ago
  • 1.1.0                                ...           3 years ago
  • 1.0.1                                ...           3 years ago
  • 1.0.0                                ...           3 years ago
Maintainers (1)
Downloads
Today 687
This Week 6,647
This Month 4,574
Last Day 2,089
Last Week 10,099
Last Month 40,939
Dependencies (0)
None
Dev Dependencies (4)
Dependents (133)