Skip to content
This repository has been archived by the owner on Jun 1, 2021. It is now read-only.

Latest commit

 

History

History
48 lines (27 loc) · 1.32 KB

README.md

File metadata and controls

48 lines (27 loc) · 1.32 KB

jqnpm logotype, a Penrose triangle

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.