aws-ip-address-lookup
aws-ip-address-lookup is a node.js module for looking up Amazon Web Services (AWS) IP address details.
See AWS IP Address Ranges.
Contents
Install
npm install aws-ip-address-lookup
Use
Example 1
const AwsIPAddressLookup = require("aws-ip-address-lookup");
let awsIPAddressLookup = new AwsIPAddressLookup();
awsIPAddressLookup.lookup('54.255.183.252', function (err, details) {
if (!err) {
console.log(JSON.stringify(details));
}
});
Result:
{
"ipAddress": "54.255.183.252",
"ipPrefix": "54.255.0.0/16",
"region": "ap-southeast-1",
"service": "AMAZON"
}
Example 2
const AwsIPAddressLookup = require("aws-ip-address-lookup");
let awsIPAddressLookup = new AwsIPAddressLookup();
awsIPAddressLookup.lookup(['54.255.183.252', '127.0.0.1', '2620:0107:300f:0000:0000:0000:0000:0000'], (err, details) => {
if (!err) {
console.log(JSON.stringify(details));
}
});
Result:
[
{
ipAddress: "54.255.183.252",
ipPrefix: "54.255.0.0/16",
region: "ap-southeast-1",
service: "AMAZON"
},
{
ipAddress: "127.0.0.1",
ipPrefix: "",
region: "",
service: ""
},
{
ipAddress: "2620:0107:300f:0000:0000:0000:0000:0000",
ipPrefix: "2620:107:300f::/64",
region: "us-west-1",
service: "AMAZON"
}
]
ChangeLog
aws-ip-address-lookup module adheres to Semantic Versioning.
[1.0.1] - 2017-04-15
Changed:
[1.0.0] - 2017-04-15
License
MIT