@jswork/next-json2base64
v1.0.9
Published
Json and base64 encode/decode.
Downloads
94
Maintainers
Readme
next-json2base64
Json and base64 encode/decode.
installation
npm install -S @jswork/next-json2base64
apis
| api | params | description | |-----------|----------|-----------------------------------------------------------| | base64 | - | js-base64 reference. | | decode | (string) | Transform base64 string to js object. | | decodeURI | (string) | Transform base64 string to js object when is in url case. | | encode | (object) | Transform object to base64 string. | | encodeURI | (object) | Transform object to base64 string when is in url case. |
usage
import NxJson2base64 from '@jswork/next-json2base64';
// code goes here:
NxJson2base64.decode('eyJuYW1lIjoiYWZlaSIsImFnZSI6MTA4fQ==');
// { name: 'afei', age: 108 }
resources
- https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent
license
Code released under the MIT license.