https://github.com/stscoundrel/ratatoskr-log
Recursive shorthand to avoid [object Object] in Node.js
https://github.com/stscoundrel/ratatoskr-log
javascript logging nodejs
Last synced: about 2 months ago
JSON representation
Recursive shorthand to avoid [object Object] in Node.js
- Host: GitHub
- URL: https://github.com/stscoundrel/ratatoskr-log
- Owner: stscoundrel
- License: mit
- Created: 2020-08-21T08:10:37.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-08-21T09:07:35.000Z (almost 6 years ago)
- Last Synced: 2025-03-25T07:38:23.978Z (over 1 year ago)
- Topics: javascript, logging, nodejs
- Language: JavaScript
- Homepage:
- Size: 26.4 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Ratatoskr
Shorthand to avoid [object Object] log in Node.js. Useful when working with deep object hierarchy.
Simple package for times when you are too lazy to remember how util.inspect worked.
### Install
`yarn add ratatoskr-log`
### Usage
Ratatoskr givers versions of common log functions, that do not have limits for depth. Log the whole object without [object Object] confusion.
```javascript
const { log } = require('ratatoskr-log')
const massiveObject = { // Deep hierarchy }
log(massiveObject)
```
Ratatoskr also gives common variants of log:
```javascript
const { debug, error, info, warn, table } = require('ratatoskr-log')
const massiveObject = { // Deep hierarchy }
debug(massiveObject)
error(massiveObject)
info(massiveObject)
warn(massiveObject)
table(massiveObject)
```
#### What's in the name?
"Ratatoskr" is a squirrel in Norse mythology, that runs up and down the world tree Yggdrasil. It carries insults between an eagle and the serpent Níðhöggr. "Insult" seems accurate way to describe the limitations of basic console.log.