@mhio/class-debug

0.1.1 • Public • Published

ClassDebug

Install

yarn add @mhio/class-debug
npm install @mhio/class-debug

Usage

API Docs

import { ClassDebug } from '@mhio/class-debug'

class Meee {
  static whatever(){
    this.debug('debug is here')
    this.debugr('debugr is here')
  }
}

// This is the bit you will need to do in code
ClassDebug.setup(Meee, 'one')

// Then you end up with `.debug()` attached to the class
console.log('debug goes below here')
Meee.debug('testing')
Meee.whatever()

// and the prototype
let meee = new Meee()
meee.debug('test instance')

Then run the example

→ DEBUG='one:*' node examples/Meee.js 
debug goes below here
  one:Meee testing +0ms
  one:Meee debug is here +1ms
  one:Meee debugr is here +0ms

Readme

Keywords

none

Package Sidebar

Install

npm i @mhio/class-debug

Weekly Downloads

0

Version

0.1.1

License

MIT

Unpacked Size

32.2 kB

Total Files

10

Last publish

Collaborators

  • mhio