JSPM

  • Created
  • Published
  • Downloads 8125
  • Score
    100M100P100Q130528F
  • License MIT

Debug utility

Package Exports

  • @superhero/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 (@superhero/debug) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Debug

Licence: MIT


npm version

A debug utility for pretty output..

Install

npm install @superhero/debug

...or just set the dependency in your package.json file:

{
  "dependencies":
  {
    "@superhero/debug": "*"
  }
}

Example

const debug = require('@superhero/debug')(/* options */);
debug('debug:', {foo:'bar', baz:'qux'});

Options

All options are optional.

{
  // cap array output
  maxArrayLength: 3,

  // define a desired color of the output:
  // [black, blue, cyan, green, magenta, red, yellow, white]
  color: undefined,

  // if false, output wont be colored.
  colors: true,

  // show timestamp in prefix.
  date: true,

  // if false, no output is made.
  debug: true,

  // depth of object inspection.
  depth: 10,

  // if an auto increment index should be printed.
  index: true,

  // a string that will prefix the output.
  prefix: false,

  // what separator to be used between prefixes and content.
  separator: ':\t'
}