dumper.js

A better and pretty variable inspector for your Node.js applications

Github星跟踪图

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

主要指标

概览
名称与所有者ziishaned/dumper.js
主编程语言JavaScript
编程语言Makefile (语言数: 2)
平台
许可证MIT License
所有者活动
创建于2018-08-06 01:16:26
推送于2025-02-06 02:52:56
最后一次提交2025-02-06 02:52:56
发布数5
最新版本名称1.3.1 (发布于 )
第一版名称0.0.1 (发布于 )
用户参与
星数2.8k
关注者数22
派生数75
提交数154
已启用问题?
问题数6
打开的问题数3
拉请求数14
打开的拉请求数6
关闭的拉请求数27
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?