npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

aws-ip-ranges

v1.3.0

Published

Fetch AWS IP ranges from official JSON source

Downloads

4,385

Readme

aws-ip-ranges

Fetch AWS's IP ranges from their official JSON source, for whatever configuration needs you have. See https://ip-ranges.amazonaws.com/ip-ranges.json for fields for available filter fields.

Valid examples:

// Get all AWS IP ranges
awsIpRanges();

// Just Cloudfront ranges
awsIpRanges('CLOUDFRONT');

// Cloudfront and EC2
awsIpRanges(['CLOUDFRONT', 'EC2']);

// Cloudfront eu-west-1
awsIpRanges({
    service: 'CLOUDFRONT',
    region: 'eu-west-1'
});

// Anything in US regions
awsIpRanges({
    region: /^us-/
});

// Arbitrary functions
awsIpRanges(function(range) {
    return myProxyList.indexOf(range.ip_prefix || range.ipv6_prefix) > -1;
});

// Combine approaches as you need. Ranges are returned if any element matches.
awsIpRanges([
    'CLOUDFRONT',
    {region: 'us-east-1'},
    function(range) { return range.ip_prefix && range.ip_prefix.split('.')[2] < 200}
]);

Output is just a list of CIDRs:

[
    "2a05:d018::/36",
    "216.137.32.0/19",
    // ...
]

You can change where the cache file is stored; use the environment variable AWS_IP_RANGES_CACHE_FILE_PATH or call awsIpRanges.setCacheFilePath(path).

Copyright (c) 2016-2017 Datanalytics, Inc. d/b/a Juristat. License under the Apache-2.0 license; see the LICENSE file for details. If you do not accept the terms of the license, you may not use this software.