@hovrcat/reorder-json
TypeScript icon, indicating that this package has built-in type declarations

1.1.6 • Public • Published

Reorder JSON

Small tool that reorders JSON keys alphabetically

Installation

npm i -g @hovrcat/reorder-json

Testing

  1. npm i

  2. npm test

Usage

From command line

Option Required Description
--i Path to the JSON file to be reordered
--o Where to save the reordered JSON file

Example: reorder -i /path/to/file.json

In code

const { Reorder } = require('@hovrcat/reorder-json');
const handler = new Reorder();
// then await the promise
await handler.reorderJSON(inputPath, outputPath);
// or handle it in the traditional way
handler.reorderJSON(inputPath, outputPath)
        .then(() => { 
            //... 
        });

Readme

Keywords

Package Sidebar

Install

npm i @hovrcat/reorder-json

Weekly Downloads

1

Version

1.1.6

License

MIT

Unpacked Size

22.1 kB

Total Files

18

Last publish

Collaborators

  • hovrcat