Skip to content
A better and pretty variable inspector for your Node.js applications
JavaScript Makefile
Branch: master
Clone or download
Latest commit b2b00d2 Jul 4, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Update FUNDING.yml May 27, 2019
__test__ Fix spacing before different data types Feb 20, 2019
src Fix spacing before different data types Feb 20, 2019
.editorconfig Update .editorconfig Sep 2, 2018
.eslintignore
.eslintrc Update Aug 3, 2018
.gitignore Update main key in package.json Aug 6, 2018
.npmignore Update Aug 3, 2018
.nvmrc Update Aug 4, 2018
.prettierrc Use babel parser for prettier May 1, 2019
.travis.yml Update node version .travis.yml Aug 5, 2018
LICENSE.md
Makefile Update Aug 4, 2018
README.md Update README.md Jul 4, 2019
index.js Minor fixes Feb 14, 2019
logo.svg Update logo Aug 5, 2018
package.json Upgrade dependencies May 1, 2019
yarn.lock Upgrade dependencies May 1, 2019

README.md

Dumper.js - Dumps information about a variable
Dumper.js

Build Status Software License

dumper.js is a better and pretty variable inspector for your Node.js applications.

Installation

npm install --save-dev dumper.js
# or you may use yarn
yarn add dumper.js --dev

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);

// Above variable will be printed
console.log('this will never be called');

Will output below result and kill the process. Demo

dd

dump() Dump and Continue

Calling dump() prints the output and continues with the processing

const { dump } = 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 }
];

dump(users);

// Above variable will be printed and the process will continue
console.log('this will be called');

Will output below result and continue processing. Demo

dump

Contributions

Feel free to submit pull requests, create issues or spread the word.

License

MIT © Zeeshan Ahmad

You can’t perform that action at this time.