Convert a buffer (or buffer accepted value) to a string.
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
.jshintrc
.travis.yml
LICENSE
README.md
index.js
package.json
test.js

README.md

Build Status

buf2str

Convert a buffer (or buffer accepted value) to a string.

Install

npm i -S buf2str

Usage

var buf2str = require('buf2str');

var base64 = 'VGhlIGxhenkgZm94IHJhbiBkb3duIHNvbWV0aGluZy4uLkkgY2FuJ3QgcmVtZW1iZXIu';
var expected = 'The lazy fox ran down something...I can\'t remember.';

// Default base64
buf2str(base64) === expected; // true