0.0.8 • Published 2 years ago

json-sorter-cli v0.0.8

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

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

json-sorter-cli [options] <string...>

Example

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

Help

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.

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:

a &
b &
is equal true

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

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago