Skip to content

Instantly share code, notes, and snippets.

@bolasblack
Last active October 5, 2018 04:45
Show Gist options
  • Save bolasblack/aa1df7eee812f2743bcf2d10c41f105e to your computer and use it in GitHub Desktop.
Save bolasblack/aa1df7eee812f2743bcf2d10c41f105e to your computer and use it in GitHub Desktop.
nodejs unlimited console.log
const util = require('util')
module.exports.global = () => {
util.inspect.defaultOptions.maxArrayLength = null
util.inspect.defaultOptions.depth = null
}
module.exports.consoleJson = () =>
console.json = (...args) =>
console.log.apply(console, args.map(arg =>
util.inspect(arg, {depth: null, maxArrayLength: null})
))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment