Skip to content
dumpkit logo

dumpkit

Zero-dependency debugging for Node.js

Inspired by PHP/Laravel's dump() and dd()

Why dumpkit?

Have you ever wasted minutes trying to understand complex data structures with console.log()?

js
// What console.log shows
console.log(user);
// { name: 'John', address: [Object], permissions: [Object], metadata: [Object] }
// You can't see what's inside! 😫

With dumpkit:

js
import { dump } from 'dumpkit';

dump(user);

Complete and readable output:

js
{
  name: "John",
  address: {
    street: "Augusta Street",
    city: "Lisbon",
    zipCode: "1100-053"
  },
  permissions: ["read", "write", "admin"],
  metadata: Map(2) {
    "created" => Date(2024-01-15T10:30:00.000Z),
    "lastAccess" => Date(2024-12-20T15:45:00.000Z)
  }
}

Debug that stops execution

Need to stop your code at a specific point to inspect?

js
import { dd } from 'dumpkit';

function processOrder(order) {
  // Validation failed? Stop everything and show
  if (!order.valid) {
    dd({ error: 'Invalid order', order });
  }
  
  // If you got here, order is valid
  return process(order);
}

dd() = dump and die - prints the value and terminates the process immediately.

Features

Simple API

dump(), dd(), trace(), measure()

Zero Dependencies

No npm baggage

Beautiful Output

Colorized and readable formatting

Circular Safe

No crash on circular references

TypeScript Ready

Full type definitions included

Zero Config

Works out of the box

Installation

bash
yarn add dumpkit

or

bash
npm install dumpkit

MIT License