# json-sorter-cli

> CLI for json-sorter-lib.

Latest version **0.0.8** (published 2022-05-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install json-sorter-cli
pnpm add json-sorter-cli
yarn add json-sorter-cli
bun add json-sorter-cli
```

Provides the command `json-sorter`.

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.8 |
| Published | 2022-05-15 |
| First published | 2022-04-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 6.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | ivanovych666 |
| Maintainers | ivanovych666 |

## Links

- npm: https://www.npmjs.com/package/json-sorter-cli
- Repository: https://github.com/ivanovych666/json-sorter-cli
- Homepage: https://github.com/ivanovych666/json-sorter-cli#readme
- Issues: https://github.com/ivanovych666/json-sorter-cli/issues
- npm.io page: https://npm.io/package/json-sorter-cli

## Dependencies (3)

- [glob](https://npm.io/package/glob.md) ^7.2.0
- [commander](https://npm.io/package/commander.md) ^9.1.0
- [json-sorter-lib](https://npm.io/package/json-sorter-lib.md) ^0.0.8

## Recent versions

- 0.0.8 (latest) — 2022-05-15
- 0.0.7 — 2022-05-15
- 0.0.6 — 2022-04-10
- 0.0.5 — 2022-04-10
- 0.0.4 — 2022-04-09
- 0.0.1 — 2022-04-09

## README

# JSON Sorter CLI

Yet, another one CLI tool to sort keys in JSON files.

## Install

`npm install --save-dev json-sorter-cli`

## CLI Usage

### Format
```bash
json-sorter-cli [options] <string...>
```

### Example

```bash
json-sorter-cli ./path/to.json ./path/to/**.json
```

### Help

```bash
json-sorter --help
```

## Why?
The main feature of this tool is that it does not use JSON.parse/JSON.stringify which might cause unescaping of Unicode escaped characters. For example, the ampersand character could be written as `&` and as `\u0026`, and both values are equal.

```javascript
const a = JSON.parse(`"&"`);
const b = JSON.parse(`"\\u0026"`);

console.log('a', a);
console.log('b', b);
console.log('is equal', a === b);
```
The result is:
```text
a &
b &
is equal true
```

This tool does not change values and leaves them as they are written.

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