Comparing version 1.0.6 to 1.0.7
{ | ||
"name": "moira", | ||
"description": "Most Outstanding IP Reporting Assistant", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"homepage": "https://github.com/mjhasbach/MOIRA", | ||
@@ -6,0 +6,0 @@ "main": "lib/moira.js", |
@@ -1,12 +0,8 @@ | ||
> # MOIRA # | ||
> Most Outstanding IP Reporting Assistant | ||
# MOIRA | ||
##### Most Outstanding IP Reporting Assistant | ||
## Description ## | ||
### Installation | ||
MOIRA is a Node module that retrieves your external IP address asynchronously. It works by requesting your IP from several different IP-fetching services simultaneously and reports the quickest result after verifying that it is a valid IP address. Similar modules that rely on only a single IP-reporting service can introduce issues in the event that the service is offline; I needed something with a bit more redundancy and reliability. | ||
You may install MOIRA via ```npm``` as follows: | ||
## Installation ## | ||
You may install MOIRA via Node Package Manager as follows: | ||
npm install moira | ||
@@ -16,25 +12,21 @@ | ||
## Usage ## | ||
### Usage | ||
Example (see test/test.js) | ||
#### moira.getIP( callback( ```err```, ```ip```, ```service``` )) | ||
var moira = require('../lib/moira'); | ||
Retrieve your external IP address asynchronously by requesting it from several different IP-fetching services simultaneously. ```moira.getIP()``` reports the quickest result after verifying that it is a valid IP address. ```err``` is null if an IP address was found. ```ip``` is an IPv4 address. ```service``` is the URL of the IP-reporting service that returned ```ip``` (e.g. http://whatismyip.akamai.com/). | ||
moira.getIP(function(err, IP, service) { | ||
if(err) { | ||
console.log("All attempts to retrieve your IP address were exhausted. Is there a problem with your connection?"); | ||
} else { | ||
console.log("Your external IP address is " + IP); | ||
console.log("The fastest service to return your IP address was " + service); | ||
} | ||
Example (see test/test.js): | ||
var moira = require( 'moira' ); | ||
moira.getIP( function( err, ip, service ){ | ||
if( err ) throw err; | ||
console.log( 'Your external IP address is ' + ip ); | ||
console.log( 'The fastest service to return your IP address was ' + service ); | ||
}); | ||
Callback Arguments | ||
### Improving MOIRA | ||
"err" - Null if an IP address was found | ||
"IP" - String - Validated IPv4 address (e.g. 74.125.239.128) | ||
"service" - String - The URL of the IP reporting service that returned the IP address (e.g. http://whatismyip.akamai.com/) | ||
## Improving MOIRA ## | ||
If you would like to contribute code or simply add an IP reporting service, feel free to submit a pull request. Please report issues [here](https://github.com/mjhasbach/MOIRA/issues). |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5111
31