Skip to content

Betterez/btrz-base64-encoder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Encode (and decode) any value to a url friendly base64 string. (Released) (Category: back-end)

Resources

License

Stars

Watchers

Forks

Packages

No packages published