Joel Purra: Developer and more


jqnpm logotype, a Penrose triangle

jq-object-sorting

Sort objects by keys or values.

⚠️ This project has been archived

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

Usage

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 }

License

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.

Live programming stream