https://github.com/knightedcodemonkey/dump
Wrapper around util.inspect to dump your nested objects to the console.
https://github.com/knightedcodemonkey/dump
console inspect nodejs wrapper
Last synced: about 2 months ago
JSON representation
Wrapper around util.inspect to dump your nested objects to the console.
- Host: GitHub
- URL: https://github.com/knightedcodemonkey/dump
- Owner: knightedcodemonkey
- Created: 2023-07-18T16:53:44.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-07-25T05:09:23.000Z (almost 3 years ago)
- Last Synced: 2025-08-16T20:15:39.596Z (10 months ago)
- Topics: console, inspect, nodejs, wrapper
- Language: JavaScript
- Homepage:
- Size: 58.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# [`@knighted/dump`](https://www.npmjs.com/package/@knighted/dump)

[](https://www.npmjs.com/package/@knighted/dump)
Wrapper around Node's `util.inpsect` to dump your nested objects to the console.
## Example
```js
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`.
```js
dump.log(nested, 'prefix') // Same output as above
```
## Options
* `obj` The object to dump
* `prefix` Helpful hint prefixed to the dump
* `opts` Same as https://nodejs.org/api/util.html#utilinspectobject-options
`dump.log(obj)` uses `until.inspect(obj, false, null, true)`.