@y13i/sort-keys-cli

0.5.0 • Public • Published

sort-keys-cli

npm version

Sort keys of the given YAML/JSON via STDIN.

Install

npm install -g @y13i/sort-keys-cli

The container image is also available.

Usage

Usage: sort-keys [options]

Sort keys of the given YAML/JSON.

Options:
  -V, --version                    output the version number
  -d, --depth <number>             how many times to recursively sort keys in a nested object or an array
  -k, --prioritize-keys <keys...>  prioritize the given keys in sorting
  -p, --prioritize-primitives      prioritize primitive values in sorting
  -o, --output <json|yaml>         output format (default: "yaml")
  -h, --help                       display help for command

Example

echo '{"b": "foo", "a": "bar"}' | sort-keys
cat something.json | npx @y13i/sort-keys-cli -o json | jq
kubectl -n kube-system -o yaml get configmap kube-root-ca.crt | docker run --rm -i ghcr.io/y13i/sort-keys-cli:latest -k apiVersion kind metadata name namespace labels annotations

Node.js Library

See y13i/sort-keys.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.5.01latest

Version History

VersionDownloads (Last 7 Days)Published
0.5.01
0.4.11
0.4.01
0.3.11
0.2.11
0.2.01

Package Sidebar

Install

npm i @y13i/sort-keys-cli

Weekly Downloads

6

Version

0.5.0

License

MIT

Unpacked Size

6.16 kB

Total Files

7

Last publish

Collaborators

  • y13i