# stdin2json

> Command-line tool for converting anything to JSON 🧀

Latest version **1.0.2** (published 2021-02-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install stdin2json
pnpm add stdin2json
yarn add stdin2json
bun add stdin2json
```

Provides the command `stdin2json`.

## 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.2 |
| Published | 2021-02-27 |
| First published | 2021-02-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8 |
| Dependencies | 7 |
| Unpacked size | 4.3 KB |
| Known vulnerabilities | 0 (+6 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | sambacha |
| Keywords | json, yaml, toml, xml, ini, cli |

## Links

- npm: https://www.npmjs.com/package/stdin2json
- Repository: https://github.com/sambacha/json-transform
- Homepage: https://github.com/sambacha/json-transform#readme
- Issues: https://github.com/sambacha/json-transform/issues
- npm.io page: https://npm.io/package/stdin2json

## Dependencies (7)

- [ini](https://npm.io/package/ini.md) ^1.3.5
- [meow](https://npm.io/package/meow.md) ^9.0.0
- [toml](https://npm.io/package/toml.md) ^2.3.3
- [xml-js](https://npm.io/package/xml-js.md) ^1.6.7
- [js-yaml](https://npm.io/package/js-yaml.md) ^3.12.0
- [get-stdin](https://npm.io/package/get-stdin.md) ^6.0.0
- [@medv/prettyjson](https://npm.io/package/@medv/prettyjson.md) ^1.0.0

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.0.2 (latest) — 2021-02-27
- 1.0.0 — 2021-02-27

## README

# stdin2json

> Command-line tool for converting **anything** to JSON.

## Features

- Eat everything, spits out json
- Supports **json**, **yaml**, **toml**, **xml**, **ini**, **cli tables**
- Formatting and highlighting
- Standalone binary

## Install

```
$ npm install -g stdin2json
```


## Usage

```
$ stdin2json resp.xml > resp.json

$ cat config.yaml | stdin2json > config.json

$ stdin2json deps.toml

$ ps | eat | fx .PID
```

### Other examples

Use it with [fx](https://github.com/antonmedv/fx) tool for extracting needed fields.

```
$ cat response.xml | eat | fx .Document.Title
```

## Related

- [fx](https://github.com/antonmedv/fx) – cli JSON processor on JS
- [any-json](https://github.com/any-json/any-json) - alternative cli tool for converting formats

## License

MIT

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