turbo-json
takes as input a path to JSON files, and combines the valid JSON's in an array written in the standart output.
The memory usage will not exceed 8kb per file as read and write are done in a streaming manner. Resulting in a very low memory usage and fast processing
The input JSON files are combined and output as one JSON array. When it encounters a JSON array as the root type of one of the input file, it will concatenate the array with the final output (see examples below).
Input files:
{ "id": 1 } // file 1
{ "id": 2 } // file 2
Output JSON:
[
{ "id": 1 },
{ "id": 2 }
]
Input files:
[ 1, 2, 3 ] // file 1
{ "id": 1 } // file 2
Output JSON:
[
1,
2,
3,
{ "id": 1 }
]
- Read and write of input and output is done in streams.
- Files JSON's format are validated before combined.
- Validation of JSON files are multithreaded.
cargo install turbo-json
turbo-json [files ...]
turbo-json tests/misc/**/*.json