Sort objects by keys or values.
No future updates are planned. Feel free to continue using it, but expect no support.
This is a package for the command-line JSON processor jq
. Install the package in your jq project/package directory with jqnpm
:
jqnpm install joelpurra/jq-object-sorting
import "joelpurra/jq-object-sorting" as ObjectSorting;
# ObjectSorting::byKeyAsc
# ObjectSorting::See also ObjectSorting::byKeyDesc.
{ "b": 1, "a": 2 } | ObjectSorting::byKeyAsc # { "a": 2, "b": 1 }
# ObjectSorting::byValueAsc
# ObjectSorting::See also ObjectSorting::byValueDesc.
{ "a": 2, "b": 1 } | ObjectSorting::byValueAsc # { "b": 1, "a": 2 }
Copyright (c) 2014, 2015, Joel Purra https://joelpurra.com/ All rights reserved.
When using jq-object-sorting, comply to the MIT license. Please see the LICENSE file for details.