@complyify/debug

1.1.1 • Public • Published

@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

Readme

Keywords

none

Package Sidebar

Install

npm i @complyify/debug

Weekly Downloads

2

Version

1.1.1

License

MIT

Unpacked Size

5.72 kB

Total Files

5

Last publish

Collaborators

  • sbruton
  • fuqua
  • ggquinones