Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/okunishinishi/node-arraysort
Node.js module for array sorting.
https://github.com/okunishinishi/node-arraysort
Last synced: 2 months ago
JSON representation
Node.js module for array sorting.
- Host: GitHub
- URL: https://github.com/okunishinishi/node-arraysort
- Owner: okunishinishi
- License: mit
- Created: 2015-08-16T23:51:49.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-11-23T02:25:16.000Z (about 9 years ago)
- Last Synced: 2024-10-12T23:38:11.886Z (3 months ago)
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/arraysort
- Size: 13.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
arraysort
==========[![Build Status][bd_travis_shield_url]][bd_travis_url]
[![Code Climate][bd_codeclimate_shield_url]][bd_codeclimate_url]
[![Code Coverage][bd_codeclimate_coverage_shield_url]][bd_codeclimate_url]
[![npm Version][bd_npm_shield_url]][bd_npm_url][bd_repo_url]: https://github.com/okunishinishi/node-arraysort
[bd_travis_url]: http://travis-ci.org/okunishinishi/node-arraysort
[bd_travis_shield_url]: http://img.shields.io/travis/okunishinishi/node-arraysort.svg?style=flat
[bd_license_url]: https://github.com/okunishinishi/node-arraysort/blob/master/LICENSE
[bd_codeclimate_url]: http://codeclimate.com/github/okunishinishi/node-arraysort
[bd_codeclimate_shield_url]: http://img.shields.io/codeclimate/github/okunishinishi/node-arraysort.svg?style=flat
[bd_codeclimate_coverage_shield_url]: http://img.shields.io/codeclimate/coverage/github/okunishinishi/node-arraysort.svg?style=flat
[bd_gemnasium_url]: https://gemnasium.com/okunishinishi/node-arraysort
[bd_gemnasium_shield_url]: https://gemnasium.com/okunishinishi/node-arraysort.svg
[bd_npm_url]: http://www.npmjs.org/package/arraysort
[bd_npm_shield_url]: http://img.shields.io/npm/v/arraysort.svg?style=flat
[bd_bower_badge_url]: https://img.shields.io/bower/v/arraysort.svg?style=flatArray sorting utility.
```bash
npm install arraysort --save
```+ [Sort Strings](#sort-strings)
### Sort Strings
`arraysort.stringCompare(options)` create a function which sort entries by string comparing.
```Javascript
"use strict";const arraysort = require('arraysort');
// Define a sort function.
let stringAsc = arraysort.stringCompare(),
stringDesc = arraysort.stringCompare({desc: true});// Execute sorting.
let values = ['foo', 'bar', 'baz'];
values = values.sort(stringAsc); // -> ['foo', 'baz', 'bar']
values = values.sort(stringDesc); // -> ['bar', 'baz', 'foo']```
License
-------
This software is released under the [MIT License](https://github.com/okunishinishi/node-arraysort/blob/master/LICENSE).Links
------+ [arrayfilter](https://github.com/okunishinishi/node-arrayfilter)
+ [arrayreduce](https://github.com/okunishinishi/node-arrayreduce)