Dumper.js
dumper.js
is a better and pretty variable inspector for your Node.js applications.
Installation
npm install --save dumper.js
yarn add dumper.js
Usage
dd()
Dump and Die
Calling dd()
prints the output and kills the process
const dd = require('dumper.js');
const users = [
{ user: 'barney', age: 36, active: true, createdAt: new Date(), getAge: () => this.age },
{ user: 'fred', age: 40, active: false, createdAt: new Date(), getAge: () => this.age },
{ user: 'pebbles', age: 1, active: true, createdAt: new Date(), getAge: () => this.age }
];
dd(users);
console.log('this will never be called');
Will output below result and kill the process
dump()
Dump and Continue
Calling dump()
prints the output and continues with the processing
const dump = require('dumper.js/src/dump');
const users = [
{ user: 'barney', age: 36, active: true, createdAt: new Date(), getAge: () => this.age },
{ user: 'fred', age: 40, active: false, createdAt: new Date(), getAge: () => this.age },
{ user: 'pebbles', age: 1, active: true, createdAt: new Date(), getAge: () => this.age }
];
dump(users);
console.log('this will be called');
Will output below result and continue processing
Contributions
Feel free to submit pull requests, create issues or spread the word.
License
MIT © Zeeshan Ahmed