0.0.1 • Published 10 years ago

ipsort v0.0.1

Weekly downloads
20
License
-
Repository
github
Last release
10 years ago

ipsort

Sort IP Addresses

Example

> var ipsort = require('./');
> ipsort(['192.168.1.5', '192.168.1.3', '192.168.1.1', '192.168.1.2'])
[ '192.168.1.1',
  '192.168.1.2',
  '192.168.1.3',
  '192.168.1.5' ]

Usage

ipsort(arr)

Given an array of IP addresses (as strings), return a sorted array.

Note: like Array.prototype.sort, the array given is modified in-place.

ipsort.compareFunction(a, b)

The compare funciton used in Array.prototype.sort

Installation

npm install ipsort

License

MIT License