dumper.js

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

  • 所有者: ziishaned/dumper.js
  • 平台:
  • 許可證: MIT License
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

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-05 17:16:26
推送於2025-02-05 18:52:56
最后一次提交2025-02-05 13:52:56
發布數5
最新版本名稱1.3.1 (發布於 )
第一版名稱0.0.1 (發布於 )
用户参与
星數2.8k
關注者數23
派生數75
提交數154
已啟用問題?
問題數6
打開的問題數3
拉請求數14
打開的拉請求數6
關閉的拉請求數27
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?