https://github.com/f2e-tools/json-stringify-format
npm package for formatting json stringify
https://github.com/f2e-tools/json-stringify-format
formatter json npm-package stringify
Last synced: about 1 month ago
JSON representation
npm package for formatting json stringify
- Host: GitHub
- URL: https://github.com/f2e-tools/json-stringify-format
- Owner: f2e-tools
- Created: 2019-11-05T08:14:05.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-03-03T08:59:33.000Z (over 3 years ago)
- Last Synced: 2025-07-22T21:09:22.930Z (11 months ago)
- Topics: formatter, json, npm-package, stringify
- Language: JavaScript
- Homepage:
- Size: 139 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# json-stringify-format
[](https://www.npmjs.org/package/json-stringify-format)
Used to format JSON strings
## Feature
- Format the JSON string
## Browser Support
```json
targets: {
"edge": "17",
"firefox": "60",
"safari": "11.1",
"chrome": "58",
"ie": "11"
}
```
## Installing
Using npm:
```bash
$ npm install json-stringify-format
```
Using yarn:
```bash
$ yarn add json-stringify-format
```
## Example
```js
import jsonFormat from 'json-stringify-format'
const originData = '{"inline":false,"defaultValue":0,"showLabel":false,"options":[{"value":0,"label":"\u5de6"},{"value":1,"label":"\u53f3"}],"required":false,"width":"","remote":false,"remoteOptions":[],"props":{"value":"value","label":"label"},"remoteFunc":""}'
processedData = jsonFormat(originData)
console.log(processedData)
{
"inline": false,
"defaultValue": 0,
"showLabel": false,
"options": [
{
"value": 0,
"label": "左"
},
{
"value": 1,
"label": "右"
}
],
"required": false,
"width": "",
"remote": false,
"remoteOptions": [
],
"props": {
"value": "value",
"label": "label"
},
"remoteFunc": ""
}
```