JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 59
  • Score
    100M100P100Q47336F
  • License MIT

wee debug utility

Package Exports

  • utils-debug

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (utils-debug) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

utils-debug progressed.io

build NPM version

wee, unintrusive debugging

install

npm install --save utils-debug

example

'use strict';

var debug = require('./.').enable();

console.log('hello');

someMethod();

function someMethod(){
  console.log('what up!');
}

and like you are used to

➜  utils-debug (master)DEBUG=example node example
at Object.<anonymous> (example.js:5:9)
hello
at someMethod (example.js:10:11)
what up!

documentation

require('utils-debug').enable();

Thats basically it.

All console.logs of that file will not print to stdout if there is no DEBUG environment variable set.

With that, just run it as you usually do with debug but instead of using some label you wrote on the source code of some file, use the path of the file relative to the project. That is if you project looks like below

project-dir
 |-- lib
     |--> code.js
 |-- test
     |--> code.js
 |-- index.js

and want to debug lib/code.js

why

You want expressive, unintrusive debugging.

todo

  • make some tests
  • be able to format the output as much as one likes
  • sorten debugging paths for node_modules directory

license

LICENSE