# ion-convert

> The [Ion](https://amzn.github.io/ion-docs/) 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.

Latest version **1.0.0** (published 2020-05-03) · 0 weekly downloads

## Install

```sh
npm install ion-convert
pnpm add ion-convert
yarn add ion-convert
bun add ion-convert
```

Provides the command `ion-convert`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2020-05-03 |
| First published | 2020-05-03 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 7.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | bradley-curran |

## Links

- npm: https://www.npmjs.com/package/ion-convert
- npm.io page: https://npm.io/package/ion-convert

## Dependencies (3)

- [jsbi](https://npm.io/package/jsbi.md) ^3.1.2
- [ion-js](https://npm.io/package/ion-js.md) ^4.0.0
- [commander](https://npm.io/package/commander.md) ^5.1.0

## Recent versions

- 1.0.0 (latest) — 2020-05-03

## README

# ion-convert

The [Ion](https://amzn.github.io/ion-docs/) 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-text
```

ion-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.ion
```

## Installation

Install using [npm](https://www.npmjs.com/): 

```
npm install -g ion-convert
```

Verify `ion-convert` is installed: 

```
ion-convert --help
```

## Cookbook

### Convert a JSON file into Ion text

```
ion-convert input.json -s json -t ion-pretty -o output.iontext
```

### See the content of an Ion binary file

```
ion-convert -s ion-binary -t ion-pretty < input.ion
```


## Source 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 object
```

## Target Types

```
ion-binary  Ion binary format
ion-pretty  Ion text that's easy to read
ion-text    Ion text with superfluous whitespace removed
```

## Support for additional Source and Target Types

If you want support for an additional source or target type please create an issue.

---
_Source: https://npm.io/package/ion-convert · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
