inspector-gadget

1.0.0 • Public • Published

inspector-gadget 🕵🗜⚙

NPM version MIT License fliphub flipfam

https://github.com/fliphub/fliphub

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

Package Sidebar

Install

npm i inspector-gadget

Weekly Downloads

11

Version

1.0.0

License

none

Last publish

Collaborators

  • aretecode