Skip to main content
Home

latest

a simple module to dump the contents of javascript objects to console, or return them as a string using dumpStr.

This package works with Node.js, BrowsersIt is unknown whether this package works with Cloudflare Workers, Deno, Bun
It is unknown whether this package works with Cloudflare Workers
This package works with Node.js
It is unknown whether this package works with Deno
It is unknown whether this package works with Bun
This package works with Browsers
JSR Score
100%
Published
a year ago (0.1.7)

a simple module to dump the contents of javascript objects to console, or return them as a string using dumpStr.

example:

import { dump } from "@console/dump";

class Sample {
    typeTest: Array<any>;
    bufferTest: Buffer;
    u8arrayTest: Uint8Array;
    arrBufferTest: ArrayBuffer;
    dvTest: DataView;

    constructor() {
        this.typeTest = [0, Number.NEGATIVE_INFINITY, true, false, null, undefined];
        this.bufferTest = Buffer.from([0xff]);
        this.u8arrayTest = new Uint8Array(this.bufferTest);
        this.arrBufferTest = this.u8arrayTest.buffer;
        this.dvTest = new DataView(this.arrBufferTest);
    }
}

dump({
    s: new Sample(),
    hello() {
        console.log("Hello, world!");
    },
});

/* prints:
{
    s: {
        typeTest: [0, -Infinity, true, false, null, undefined],
        bufferTest: "FF",
        u8arrayTest: [255],
        arrBufferTest: [255],
        dvTest: [255]
    },
    hello: function hello(...args)
}
*/

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@console/dump

Import symbol

import * as dump from "@console/dump";
or

Import directly with a jsr specifier

import * as dump from "jsr:@console/dump";

Add Package

pnpm i jsr:@console/dump
or (using pnpm 10.8 or older)
pnpm dlx jsr add @console/dump

Import symbol

import * as dump from "@console/dump";

Add Package

yarn add jsr:@console/dump
or (using Yarn 4.8 or older)
yarn dlx jsr add @console/dump

Import symbol

import * as dump from "@console/dump";

Add Package

vlt install jsr:@console/dump

Import symbol

import * as dump from "@console/dump";

Add Package

npx jsr add @console/dump

Import symbol

import * as dump from "@console/dump";

Add Package

bunx jsr add @console/dump

Import symbol

import * as dump from "@console/dump";