Have ideas to improve npm?Join in the discussion! »

btrz-base64-encoder

1.2.0 • Public • Published

btrz-base64-encoder

This module encodes and decodes strings, values and objects literals to url friendly base64 strings.

Runtimes supported

io.js >= 1.0.3 node >= v0.11.x

Install

npm install btrz-base64-encoder --save

Usage

var base64 = require("btrz-base64-encoder");
var obj = {
    "name": "John",
    "last": "Smith",
    "age": 24
};
var encoded = base64.encode(obj);
//
var decode = base64.decode(encoded);
/*
    {
        "name": "John",
        "last": "Smith",
        "age": 24
    }
*/

You can pass anything to the encode method. Internally will use JSON.stringify to deal with Objects, so all restrictions regarding depth for the stringify method also apply in this case.

Install

npm i btrz-base64-encoder

DownloadsWeekly Downloads

142

Version

1.2.0

License

MIT

Unpacked Size

7.65 kB

Total Files

6

Last publish

Collaborators

  • avatar
  • avatar