A simple debug tool to display debug messages where needed. Perfect for testing models, and routes.
npm install debug-squasher --save
Create a log
folder in your project with the file lincoln.log
. This will be to save all your debug messages.
/log/lincoln.log
Require the 'debug-squasher' package.
const util = require('debug-squasher');
user can decide what the output message should be. A 2nd parameter is available for data output object. The last parameter is telling which console method to use.
// Takes a title, object , and either log, error or warn
util.debug('title', object, 'log | error | warn')
debug-squasher runs only when the Environmental Variable 'DEBUG' is on.
DEBUG=true node src/util.js
visit my app-store project to see it in action.