# good-sort-json

> Sort json the good way

Latest version **0.2.1** (published 2018-03-21) · ISC license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install good-sort-json
pnpm add good-sort-json
yarn add good-sort-json
bun add good-sort-json
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.2.1 |
| Published | 2018-03-21 |
| First published | 2018-03-20 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Daniel Perez Alvarez |
| Maintainers | danielpanpm |
| Keywords | json, parse |

## Links

- npm: https://www.npmjs.com/package/good-sort-json
- Repository: https://github.com/danielpa9708/good-sort-json
- Homepage: https://github.com/danielpa9708/good-sort-json#readme
- Issues: https://github.com/danielpa9708/good-sort-json/issues
- npm.io page: https://npm.io/package/good-sort-json

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 0.2.1 (latest) — 2018-03-21
- 0.2.0 — 2018-03-21
- 0.1.2 — 2018-03-20
- 0.1.0 — 2018-03-20

## README

# good-sort-json

Sort json the good way.

json is sorted as follows: literals, objects, arrays and then alphabetically.


## Example

```js
const jsonSort = require("good-sort-json");
console.log(jsonSort({
    id: "asdf",
    health: 98,
    weapons: [{
        type: "thrust",
        damage: 57,
    }],
    alarms: ["12.30pm"],
    armor: {
        resistance: [{ type: "thrust", value: 100 }],
        type: "leather",
    },
}));
```

outputs

```json
{
  "health": 98,
  "id": "asdf",
  "armor": {
    "type": "leather",
    "resistance": [
      {
        "type": "thrust",
        "value": 100
      }
    ]
  },
  "alarms": [
    "12.30pm"
  ],
  "weapons": [
    {
      "damage": 57,
      "type": "thrust"
    }
  ]
}
```

---
_Source: https://npm.io/package/good-sort-json · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
