1.3.25 • Published 2 years ago

@kikobeats/jsonsort v1.3.25

Weekly downloads
26
License
MIT
Repository
github
Last release
2 years ago

@kikobeats/jsonsort

Last version Build Status NPM Status

Sort an object or a collection of objects based on a criteria.

Install

$ npm install @kikobeats/jsonsort --global

CLI

$ jsonsort <file>[flags]

Flags
  --criteria  Specify the criteria to sort. It can be a key name or fat arrow function.
  --quiet     Avoid print output
  --save      Write the output back. If a path is specified, it will be used over the original

Examples
  $ jsonsort file.json # Just output a sorted json
  $ jsonsort file.json --criteria name # Sort an array of objects based on alphabetical `name` value.
  $ jsonsort file.json --criteria 'x => x.featured' # Passing a function as criteria.
  $ jsonsort file.json --criteria name --save # Sort and save the result.
  $ jsonsort file.json --criteria name --save # Sort, save but dont print result.

It's easy to complement with others UNIX commands, like jq:

jq .redirects now.json | jsonsort --criteria source

License

jsonsort © Kiko Beats, released under the MIT License. Authored and maintained by Kiko Beats with help from contributors.

kikobeats.com · GitHub Kiko Beats · Twitter @Kikobeats

1.3.24

2 years ago

1.3.25

2 years ago

1.3.23

3 years ago

1.3.21

3 years ago

1.3.22

3 years ago

1.3.20

3 years ago

1.3.18

4 years ago

1.3.19

3 years ago

1.3.17

4 years ago

1.3.16

5 years ago

1.3.15

5 years ago

1.3.14

5 years ago

1.3.13

5 years ago

1.3.12

5 years ago

1.3.11

5 years ago

1.3.10

5 years ago

1.3.9

5 years ago

1.3.7

5 years ago

1.3.8

5 years ago

1.3.6

5 years ago

1.3.5

5 years ago

1.3.4

5 years ago

1.3.3

5 years ago

1.3.2

6 years ago

1.3.1

6 years ago

1.3.0

6 years ago

1.2.0

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago