1.0.0 • Published 7 years ago
inspector-gadget v1.0.0
inspector-gadget 🕵🗜⚙
preconfigured nodejs util for inspecting, and customizing inspecting
inspectorGadget 🗜
configure what is exposed when inspecting
const {inspectorGadget} = require('inspector-gadget')
class Eh {
constructor() {
this.inspect = inspectorGadget(this, ['property-to-ignore'])
}
}
inspector 🕵
const {inspector} = require('inspector-gadget')
const inspected = inspector({
some: {
super: {
deep: {
data: {
with: {
colors: function() {
this.array = ['with inspection with colors pre configured']
}
}
}
}
}
}
})
console.log(inspected)
custom ⚙
const {custom} = require('inspector-gadget')
// disables
custom(false)
// re-enables
custom(true)
// changes to your value, be careful.
custom(() => {})
options
- if it fails to inspect, it will javascript-stringify
- second arg is a number, how deep you want to go (default 30)
- 3rd arg is options to override pre-configured nodejs util inspect options
- it also exports
util
, for your convenience in destructuring