1.0.3 • Published 9 years ago
base64object v1.0.3
base64object
Encode and decode objects without stringify / parseing the data in browser / node
Install
npm
npm install base64objectyarn
yarn add base64objectUsage
base64object.encode({ hello: 'world' })
// response eyJoZWxsbyI6IndvcmxkIn0=
base64object.decode('eyJoZWxsbyI6IndvcmxkIn0=')
// response { hello: 'world' }Support
Browser
Under the hood it uses the window.atob() native feature which is supported in each major browser and IE from version 10 (check mozilla dev site)
Node
Uses the native Buffer API from node (check node documentation)