node-sort

A sorting library for Node.js

npm install node-sort
2 downloads in the last day
13 downloads in the last week
39 downloads in the last month

node-sort

A sorting library for Node.js

Installation

Install using the node.js package manager npm:

  $ npm install node-sort

Or...

Install via git clone:

  $ git clone git://github.com/KevinTCoughlin/node-sort.git
  $ cd node-sort
  $ npm install

Requirements

You can install node-sort and its dependencies with npm:

  $ npm install node-sort

Dependencies

Examples

Demos of the node-sort module are located in: ./examples

API Documentation

Parameters

  • array - array to be sorted
  • comparator - function that defines how to compare objects in array. == returns 0, < returns -1, > returns 1. If none is provided default is used.

Functions

  • Merge Sort - .mergeSort( array, [comparator] )

  • Selection Sort - .selectionSort( array, [comparator] )

  • Quick Sort - .quickSort( array, [comparator] )

Testing

Issue the following Make command in the top directory to run the mocha.js test cases:

  $ make test

LICENSE

node-sort: Copyright (c) 2013 Kevin Coughlin

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

npm loves you