stringify-buffer
Converts a buffer a collection of strings, one for each possible encoding.
Last updated 4 years ago by thlorenz .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install stringify-buffer 
SYNC missed versions from official npm registry.

stringify-buffer build status

Converts a buffer a collection of strings, one for each possible encoding.

const stringify = require('stringify-buffer')
const buf = Buffer.from('Hello ☃')
console.log(stringify(buf))
{ ascii: 'Hello b\u0018\u0003',
  utf8: 'Hello ☃',
  utf16le: '效汬飢',
  binary: 'Hello ☃',
  base64: 'SGVsbG8g4piD',
  hex: '48656c6c6f20e29883' }

Installation

npm install stringify-buffer

API

stringifyBuffer

Stringifies the given buffer once for each encoding and adds the result a hash.

Parameters

Returns Object<string, string> a hash with a string value of the buffer for each of the supplied encodings

stringifyBuffer.encodings

Returns an array of all valid Buffer encodings that are supported. This is the same array that is used if no encodings is passed to @see stringifyBuffers.

Returns Array<string> all valid Buffer encodings

License

MIT

Current Tags

  • 1.1.0                                ...           latest (4 years ago)

3 Versions

  • 1.1.0                                ...           4 years ago
  • 1.0.1                                ...           4 years ago
  • 1.0.0                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (3)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |