manakin
Red & Yellow colors for your console.error
and console.warn
messages.
You can start using the existing console.error
+ console.warn
methods, and then add manakin
later at any time.
You can either set colors globally, for the entire process, or use them locally.
minimum code ✔ no dependencies ✔ all platforms ✔
Installing
$ npm install manakin --save
Usage
Node.js
- For global usage:
require('manakin').global; // also returns {error, warn};
console.warn(val1, val2, ...);
console.error(val1, val2, ...);
- For local usage:
var con = require('manakin'); // = require('manakin').local;
con.warn(val1, val2, ...);
con.error(val1, val2, ...);
Browsers:
<script src="manakin.js"></script>
In browsers, we set console.error
and console.warn
only when they are not defined.
License
Copyright © 2016 Vitaly Tomilov; Released under the MIT license.