🚀 Big News:Socket Has Acquired Secure Annex.Learn More →
Socket
Book a DemoSign in
Socket

buffer-to-string

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

buffer-to-string

A better Buffer.toString()

latest
Source
npmnpm
Version
0.1.0
Version published
Weekly downloads
11
22.22%
Maintainers
1
Weekly downloads
 
Created
Source

buffer-to-string Build Status

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 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.

License

MIT © Isaac Z. Schlueter, James Talmage

Keywords

buffer

FAQs

Package last updated on 16 Jan 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts