Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bahamas10/node-ipsort
Sort IP Addresses
https://github.com/bahamas10/node-ipsort
Last synced: about 2 months ago
JSON representation
Sort IP Addresses
- Host: GitHub
- URL: https://github.com/bahamas10/node-ipsort
- Owner: bahamas10
- Created: 2013-12-26T23:12:40.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2013-12-28T01:07:52.000Z (almost 11 years ago)
- Last Synced: 2024-10-02T01:56:37.773Z (3 months ago)
- Language: JavaScript
- Size: 105 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
ipsort
=======Sort IP Addresses
Example
-------``` js
> 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