Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alsotang/sortobj
I can sort Object in JavaScript
https://github.com/alsotang/sortobj
Last synced: 13 days ago
JSON representation
I can sort Object in JavaScript
- Host: GitHub
- URL: https://github.com/alsotang/sortobj
- Owner: alsotang
- Created: 2013-11-21T13:16:01.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2013-12-20T02:36:10.000Z (about 11 years ago)
- Last Synced: 2024-11-03T17:05:03.860Z (2 months ago)
- Language: JavaScript
- Size: 113 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# sortobj
[![Build Status](https://travis-ci.org/alsotang/sortobj.png?branch=master)](https://travis-ci.org/alsotang/sortobj)
Convert Object to corresponding sorted-key Array.
## Installation
```shell
$ npm install sortobj
```## Examples
```js
var sortobj = require('sortobj');obj = {b: {z: 1, y: 2}, c: 3, a: 1};
arr = [['a', 1], ['b', [['y', 2], ['z', 1]]], ['c', 3]];
sortobj(obj).should.eql(arr);
```