Skip to content

Combines provided JSON files into one JSON. Both read and write are done using streaming. Avoiding the content to be kept in memory.

Notifications You must be signed in to change notification settings

bidoubiwa/turbo-json

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TURBO-JSON

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

Example

How JSON files are combined

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).

Example 1

Input files:

{ "id": 1 } // file 1
{ "id": 2 } // file 2

Output JSON:

[
  { "id": 1 },
  { "id": 2 }
]

Example 2

Input files:

[ 1, 2, 3 ] // file 1
{ "id": 1 } // file 2

Output JSON:

[
  1,
  2,
  3,
  { "id": 1 }
]

Features

  • 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.

CLI

Installation

cargo install turbo-json

Usage

turbo-json [files ...]

Example

turbo-json tests/misc/**/*.json

About

Combines provided JSON files into one JSON. Both read and write are done using streaming. Avoiding the content to be kept in memory.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages