@nod/console
v6.1.0
Published
A console that can outputs syntax highlighted JSON with circular reference support
Downloads
49
Readme
@nod/console
A console that can outputs syntax highlighted JSON with circular reference support
It also supports outputting circular references.
Supports ES5, ES7, CommonJS, System, ES6 modules, and AMD. Works in node.js also should (not tested yet) work in browser.
##Usage:
Installation:
npm install --save @nod/console
Examples:
import { Console, Configuration as ConsoleConfig } from '@nod/console';
let console = new Console(new ConsoleConfig());
let { error, warn, info, log, debug } = console;
log('Simple log');
error('DOH');
info('Too much info');
console.warn('This is a warning human !');
ES5 AMD
require('@nod/console', function(nodConsole) {
var console = new nodConsole.Console();
console.info('RequireJS is so 2013.');
});
ES5 CommonJS
var nodConsole = require('@nod/console');
var console = new nodConsole.Console();
console.info('ES5 is boring but it also works.');
Configuration
import { Console, Configuration } from '@nod/console';
let options = new Configuration({ // this will auto merge options
enabled : true, // disable and enable switch
logTypes : false, // log also variable types
level : 'debug', // debug < log < info < warn < error
});
let standart = {
output : console.log.bind(console),
error : console.error.bind(console)
};
let console = new Console(options, standart);
All methods have strict type checking please check source code.
Build and develop:
gulp
or
npm run default
Please check available gulp tasks with:
gulp -T
TODO:
- Gulp tasks as another dependency
- Maybe add stream support
- Add inline docs
Contact:
by NOD studios