@y13i/sort-keys-cli
v0.8.3
Published
Sort keys of the given YAML/JSON via STDIN.
Readme
sort-keys-cli
Sort YAML/JSON keys via STDIN.
Install
npm install -g @y13i/sort-keys-cliThe container image is also available.
Usage
Usage: sort-keys [options]
Sort YAML/JSON keys via STDIN.
Options:
-V, --version output the version number
-d, --depth <number> limits how many levels deep to recursively sort nested objects and arrays.
-k, --prioritize-keys <keys...> keys listed here are moved to the front, in the order given, before the remaining keys are sorted alphabetically.
-p, --prioritize-primitives keys with primitive values (numbers, strings, booleans, null, undefined) are sorted before keys with object or array values.
-o, --output <json|yaml> output format (default: "yaml")
-h, --help display help for commandExample
echo '{"b": "foo", "a": "bar"}' | sort-keyscat something.json | npx @y13i/sort-keys-cli -o json | jqkubectl -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 annotationsJavaScript Library
See y13i/sort-keys.
