@tamtamchik/json-deep-sort
TypeScript icon, indicating that this package has built-in type declarations

1.1.3 • Public • Published

JSON Deep Sort

Buy Me A Coffee Latest Version on NPM Scrutinizer build Scrutinizer quality Scrutinizer coverage Software License Total Downloads

JSON Deep Sort is a comprehensive package that provides flexible sorting of JSON objects by keys. This TypeScript-written package can handle deeply nested objects and arrays, and offers both synchronous and asynchronous operations.

Installation

Using npm:

npm install @tamtamchik/json-deep-sort

Using yarn:

yarn add @tamtamchik/json-deep-sort

Usage

Import JSON Deep Sort in your TypeScript file:

import { sort } from '@tamtamchik/json-deep-sort';

Here is an example of sorting a JSON object:

let data = {
    b: 'b',
    a: 'a',
    c: {
        d: 'd',
        c: 'c',
        a: 'a',
        b: 'b'
    }
};

let sortedData = sort(data, true);
// { a: 'a', b: 'b', c: { a: 'a', b: 'b', c: 'c', d: 'd' } }

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

JSON Deep Sort is MIT licensed.

Package Sidebar

Install

npm i @tamtamchik/json-deep-sort

Weekly Downloads

3

Version

1.1.3

License

MIT

Unpacked Size

9.71 kB

Total Files

7

Last publish

Collaborators

  • tamtamchik