1.0.0 • Published 5 years ago
ion-convert v1.0.0
ion-convert
The Ion data format is a richly-typed, self-describing, hierarchical data serialization format. It has both a text version which is a superset of JSON and a compact binary version.
ion-convert converts various data formats to and from the Ion format.
It reads the input according to the given source type and outputs the target type. For example:
echo '{"name": "Jeff"}' | ion-convert --source-type json --target-type ion-text
{
name:"Jeff"
}Short argument flags are available as well:
echo '{"name": "Jeff"}' | ion-convert -s json -t ion-textion-convert reads from stdin and writes to stdout by default. Alternatively, you can specify input and output files as arguments:
ion-convert input.json --source-type json --target-type ion-text --output-file output.ionInstallation
Install using npm:
npm install -g ion-convertVerify ion-convert is installed:
ion-convert --helpCookbook
Convert a JSON file into Ion text
ion-convert input.json -s json -t ion-pretty -o output.iontextSee the content of an Ion binary file
ion-convert -s ion-binary -t ion-pretty < input.ionSource Types
ion-binary Ion binary format
ion-text Ion text format
json Formatted according to RFC 7159
json-lines Each line is a separate JSON objectTarget Types
ion-binary Ion binary format
ion-pretty Ion text that's easy to read
ion-text Ion text with superfluous whitespace removedSupport for additional Source and Target Types
If you want support for an additional source or target type please create an issue.