https://github.com/afeiship/next-json2base64
Json and base64 encode/decode.
https://github.com/afeiship/next-json2base64
b64 base64 json next parse stringify
Last synced: about 1 month ago
JSON representation
Json and base64 encode/decode.
- Host: GitHub
- URL: https://github.com/afeiship/next-json2base64
- Owner: afeiship
- License: mit
- Created: 2019-05-10T07:25:18.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2026-05-04T08:40:54.000Z (about 1 month ago)
- Last Synced: 2026-05-04T10:31:42.526Z (about 1 month ago)
- Topics: b64, base64, json, next, parse, stringify
- Language: JavaScript
- Homepage:
- Size: 51.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# next-json2base64
> Json and base64 encode/decode.
[![version][version-image]][version-url]
[![license][license-image]][license-url]
[![size][size-image]][size-url]
[![download][download-image]][download-url]
## installation
```bash
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
```js
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](https://github.com/afeiship/next-json2base64/blob/master/LICENSE.txt).
[version-image]: https://img.shields.io/npm/v/@jswork/next-json2base64
[version-url]: https://npmjs.org/package/@jswork/next-json2base64
[license-image]: https://img.shields.io/npm/l/@jswork/next-json2base64
[license-url]: https://github.com/afeiship/next-json2base64/blob/master/LICENSE.txt
[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/next-json2base64
[size-url]: https://github.com/afeiship/next-json2base64/blob/master/dist/next-json2base64.min.js
[download-image]: https://img.shields.io/npm/dm/@jswork/next-json2base64
[download-url]: https://www.npmjs.com/package/@jswork/next-json2base64