good-sort-json

Sort json the good way

Package no longer maintained
Last updated 4 years ago by danielpanpm .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install good-sort-json 
SYNC missed versions from official npm registry.

good-sort-json

Sort json the good way.

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

Example

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

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

Current Tags

  • 0.2.1                                ...           latest (4 years ago)

4 Versions

  • 0.2.1 [deprecated]           ...           4 years ago
  • 0.2.0 [deprecated]           ...           4 years ago
  • 0.1.2 [deprecated]           ...           4 years ago
  • 0.1.0 [deprecated]           ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 2
Last Day 0
Last Week 1
Last Month 1
Dependencies (0)
None
Dev Dependencies (2)
Dependents (1)

Copyright 2014 - 2021 © npmmirror.com |