@complyify/debug

Complyify's debug extensions

Stats

StarsIssuesVersionUpdatedCreatedSize
@complyify/debug
101.1.12 years ago5 years agoMinified + gzip package size for @complyify/debug in KB

Readme

@complyify/debug

Drop in replacement for debug that adds some additional formatter extensions described below.

Installation

npm install @complyify/debug

Formatters

%b bit array from a number or a buffer

import Debug from '@complyify/debug';
const debug = Debug('test:app');
const buffer = new Buffer(1);
buffer.fill(0);
const byte = 0b10101010;
debug('some buffer as a bit array: %b', buffer);
debug('some number as a bit array: %b', byte);

results in debug output

  test:app some buffer as a bit array: 0,0,0,0,0,0,0,0
  test:app some buffer as a bit array: 1,0,1,0,1,0,1,0

%h hex string from a number or a buffer

import Debug from '@complyify/debug';
const debug = Debug('test:app');
const buffer = new Buffer(1);
buffer.fill(0);
const byte = 0b10101010;
debug('some buffer as a hex string: %h', buffer);
debug('some number as a hex string: %h', byte);

results in debug output

  test:app some buffer as a hex string: 0x00
  test:app some buffer as a hex string: 0xAA

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.