node-easylog
v1.4.2
Published
A simple node module that prints friendly messages to the console
Downloads
2
Readme
node-easylog
A simple promise based node module that prints friendly messages asynchronously to the console
Features
Install
npm install --save node-easylog
Usage
Node-easylog currently has only a "log" method that takes an object with a mandatory "message" key
var logger = require('node-easylog'); // require the module
logger.log({'message': 'Hello World'}) // logs "Hello World" to the console
Log Types
The "log" method takes an optional second key "logType" whose accepted values are: "success", "error" , "warn", and "notice"
var logger = require('node-easylog');
logger.log({'message': 'Hello World', 'logType': 'success'}) // logs "Hello World" in the green color
logger.log({'message': 'Hello World', 'logType': 'error'}) // logs "Hello World" in the red color
logger.log({'message': 'Hello World', 'logType': 'warn'}) // logs "Hello World" in the yellow color
logger.log({'message': 'Hello World', 'logType': 'notice'}) // logs "Hello World" in the blue color
Test
- npm run test :
mocha src/test/index.js -w
Dependencies
Package | Version | Dev --- |:---:|:---: cli-color | ^1.1.0 | ✖ pretty-error | ^2.0.2 | ✖ babel-cli | ^6.23.0 | ✔ chai | ^3.5.0 | ✔ mocha | ^3.2.0 | ✔ node-readme | ^0.1.9 | ✔
Contributing
Contributions welcome; Please submit all pull requests the against master branch. If your pull request contains JavaScript patches or features, you should include relevant unit tests. Please check the Contributing Guidelines for more details. Thanks!
Author
Gabriel Ferraz
License
- MIT : http://opensource.org/licenses/MIT