@watchmen/debug
v2.0.0
Published
wrapper around the popular [debug](https://github.com/visionmedia/debug) module that generates a conventional namespace from node's current file name variable ([\_\_filename](https://github.com/visionmedia/debug))
Downloads
12
Readme
node-debug
wrapper around the popular debug module that generates a conventional namespace from node's current file name variable (__filename)
see tests for examples
usage
yarn add <package name>
import debug from '@watchmen/debug'
const dbg = debug(__filename) // <-- returns an instance of "core" debug object
dbg('data=%o', data)
example namespaces
| package name
| __filename
| namespace
|
| ---------------------- | ------------------------------------------ | ------------------------------------------ |
| my-package
| /Users/me/my-package/app/stuff/helper.js
| dbg:my-package:app:stuff:helper
|
| my-package
| /Users/me/my-package/app/stuff/index.js
| dbg:my-package:app:stuff
|
| @my-group/my-package
| /Users/me/my-package/app/stuff/helper.js
| dbg:my-group:my-package:app:stuff:helper
|
development
git clone {repo name}
cd {repo name}
yarn
yarn test