sort-deep-object-arrays
Sort objects and arrays of objects nested deeply within other objects or arrays
Requirements
- Node.js v0.12 or higher
Usage
Install as a local dependency for your project:
yarn add sort-deep-object-arrays
Run in command line
npx sort-deep-object-arrays /path/to/input/file.json
Require and use it in your code:
const sortDeepObjectArrays = ; const myUnsortedObject = b: 2 a: 1 d: 3 5 1 c: 3 e: f: 7 g: 8 h: 9 g: 2 h: 3 f: 1 g: 5 f: 4 h: 6 ; const mySortedObject = ; console;
This should output:
Tests
Run tests with npm test
. Written in tape. Automatically tested using Travis CI
Tests run against Node 0.12, 4, 6, 8, 10 and 12.