0.1.1 • Published 3 years ago

collate-json-cli v0.1.1

Weekly downloads
2
License
MIT
Repository
github
Last release
3 years ago

collate-json-cli

CLI to collate the contents of several JSON files and write an array to a single file.

Usage

$ npx collate-json cli data/*.json result.json

For each source file, if the root is an object, that's added to the result array. If the root is itself an array, its items are added to the result array.

Example

Sources:

{
  "name": "Tom"
}
[
  {
    "name": "Dick"
  },
  {
    "name": "Harry"
  }
]

Result:

[
  {
    "name": "Tom"
  },
  {
    "name": "Dick"
  },
  {
    "name": "Harry"
  }
]