@isaacs/buffer-to-string
A better Buffer.toString()
Last updated a year ago by isaacs .
BlueOak-1.0.0 · Repository · Bugs · Original npm · Tarball · package.json
$ npm install @isaacs/buffer-to-string 
SYNC missed versions from official npm registry.

buffer-to-string

A better Buffer.toString()

Displays buffer content in hex. Characters are grouped into two-character bytes, with a customizable line wrap width.

Install

$ npm install --save @isaacs/buffer-to-string

Usage

const bufferToString = require('buffer-to-string')

bufferToString(new Buffer([0, 1, 2, 3, 4, 5, 6]), 3)
/*
00 01 02
03 04 05
06
 */

API

bufferToString(buffer, [width])

input

Type: Buffer

The Buffer to stringify.

width

Type: number
Default: 20

The maximum width before wrapping a newline. It is measured in bytes displayed. The maximum character width can be determined by computing (3 * width) - 1.

Current Tags

  • 1.0.1                                ...           latest (a year ago)

2 Versions

  • 1.0.1                                ...           a year ago
  • 1.0.0                                ...           a year ago
Maintainers (1)
Downloads
Total 8
Today 0
This Week 0
This Month 6
Last Day 0
Last Week 4
Last Month 2
Dependencies (0)
None
Dev Dependencies (4)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE