1.0.1 • Published 7 years ago

aws-ip-address-lookup v1.0.1

Weekly downloads
6
License
MIT
Repository
github
Last release
7 years ago

aws-ip-address-lookup

Build Status Dependencies Status

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:

  • Update examples

1.0.0 - 2017-04-15

  • First release

License

MIT