https://github.com/jxm262/lil-json
Convert Large Json files into lil json files
https://github.com/jxm262/lil-json
json shrink
Last synced: 5 months ago
JSON representation
Convert Large Json files into lil json files
- Host: GitHub
- URL: https://github.com/jxm262/lil-json
- Owner: jxm262
- License: mit
- Created: 2017-06-10T18:42:27.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-06-10T19:18:47.000Z (about 9 years ago)
- Last Synced: 2025-10-19T15:27:11.190Z (8 months ago)
- Topics: json, shrink
- Language: JavaScript
- Size: 8.79 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# lil-json [](https://travis-ci.org/jxm262/lil-json)
Convert large json into lil json!
## Installation
```
npm install -g lil-json
```
## Usage
```
lil-json file_1.json file_2.json file_3.json
```
Creates and saves shortened files - myfile_1.lil.json, myfile_2.lil.json, myfile_3.lil.json
- All arrays are shortened to contain only 3 elements
## Why?
We sometimes want to take large json files and convert them to smaller ones, so we can use them for unit tests, better readability, etc..
This typically occurs with array values with a large number of elements.
```
{
"prop1": "some value",
"prop2": 34.5,
"prop3": [
[
[
"value 1",
"value 2",
"value 3",
"value 4",
"value 5",
"value 6",
// 10 gazillion more records....
],
...
],
...
]
}
// converts to smaller obj
{
"prop1": "some value",
"prop2": 34.5,
"prop3": [
[
[
"value 1",
"value 2",
"value 3"
]
]
]
}
```
## License
MIT
Please refer to the LICENSE file for details.