Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mikaello/re-ndjson
Convert to and from NDJSON
https://github.com/mikaello/re-ndjson
cli converter ndjson reasonml
Last synced: about 1 month ago
JSON representation
Convert to and from NDJSON
- Host: GitHub
- URL: https://github.com/mikaello/re-ndjson
- Owner: mikaello
- License: mit
- Created: 2019-06-07T16:46:21.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-08-01T08:41:21.000Z (over 5 years ago)
- Last Synced: 2024-10-04T16:22:04.086Z (4 months ago)
- Topics: cli, converter, ndjson, reasonml
- Language: OCaml
- Homepage: http://ndjson.org/
- Size: 106 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# re-ndjson
[![Build Status](https://dev.azure.com/mikaeo/re-ndjson/_apis/build/status/mikaello.re-ndjson?branchName=master)](https://dev.azure.com/mikaeo/re-ndjson/_build/latest?definitionId=1&branchName=master)
Convert to and from [NDJSON](https://en.wikipedia.org/wiki/JSON_streaming#Line-delimited_JSON)/JSON. If no option is given, the tool will infer what type of input it got and convert to the other.
## Usage
Download the OSX binary from the [release page](https://github.com/mikaello/re-ndjson/releases) or build the binary as described in the _Build_-section.
`ndjson --help`:
```
ndjson(1) Ndjson Manual ndjson(1)NAME
ndjson - convert to/from NDJSON to/from JSONSYNOPSIS
ndjson [OPTION]... FILEDESCRIPTION
ndjson convert FILE to JSON if it is in NDJSON format, if FILE is in
JSON format it will be converted to NDJSON. The result is printed to
standard output.ARGUMENTS
FILE (required)
FILE must either be a file on your computer, or it must be '-' to
take input from stdinOPTIONS
--help[=FMT] (default=auto)
Show this help in format FMT. The value FMT must be one of `auto',
`pager', `groff' or `plain'. With `auto', the format is `pager` or
`plain' whenever the TERM env var is `dumb' or undefined.-j, --from-json
Convert from JSON file-n, --from-ndjson
Convert from NDJSON file--version
Show version information.EXIT STATUS
ndjson exits with the following status:0 on success.
124 on command line parsing errors.
125 on unexpected internal errors (bugs).
BUGS
Open issue in https://github.com/mikaello/re-ndjson/issues.SEE ALSO
https://github.com/madnight/ndjson-to-json and
https://github.com/nypl-spacetime/json-to-ndjsonNdjson 1.0.0 ndjson(1)
```## Build
If you want to build this program yourself, you need to have [_esy_](https://esy.sh/) installed and follow these instructions:
```
$ git clone https://github.com/mikaello/re-ndjson
$ cd re-ndjson
$ esy install
$ esy build
```And make `_esy/default/store/b/re_ndjson-/default/executable/ReNdjsonApp.exe` available on your `$PATH` with a name you like. E.g.
```
$ cp -p _esy/default/store/b/re_ndjson-/default/executable/ReNdjsonApp.exe ~/bin/ndjson
$ echo "export PATH=\"$HOME/bin:$PATH\"" > ~/.bashrc
```## Contribute
The program is written in ReasonML and compiled to native. Feel free to open a PR or issue if you find something that could be better :-)
## Alternatives
* See [libraries section](http://ndjson.org/libraries.html) on ndjson.org
* [jq](https://stedolan.github.io/jq/) handles NDJSON out of the box