@knighted/dump

1.0.3 • Public • Published

@knighted/dump

CI NPM version

Wrapper around Node's util.inpsect to dump your nested objects to the console.

Example

import { dump } from '@knighted/dump'

const nested = {
  knighted: {
    code: {
      monkey: {
        bananas: true
      }
    }
  }
}

dump({
  obj: nested,
  prefix: 'prefix',
  opts: { depth: 3, colors: true }
})

Output:

prefix {
  knighted: { code: { monkey: { bananas: true } } }
}

Or simply use dump.log if not passing opts.

dump.log(nested, 'prefix') // Same output as above

Options

dump.log(obj) uses until.inspect(obj, false, null, true).

Package Sidebar

Install

npm i @knighted/dump

Weekly Downloads

5

Version

1.0.3

License

MIT

Unpacked Size

3.63 kB

Total Files

4

Last publish

Collaborators

  • knightedcodemonkey