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 🙏

© 2025 – Pkg Stats / Ryan Hefner

ec2snapshots

v0.0.2

Published

A utility for creating snapshots, and removing them after a retention period defined in volume tags

Readme

ec2snapshots

This is a utility which creates snapshots and purges them after a set number of retention days defined in AWS volume tags.

Each time the script is run, it will do the following for each volume which contains a Snapshot tag:

  • Purge snapshots older than the retention period (number of days defined as the value in the tag)
  • Create a new snapshot (Description format: [volume-id]_[volume-name]_YYYYMMDDHHSS)

Installation

1) Install ec2snapshots

npm install -g ec2snapshots

2) Add your credentials to ~/.aws/credentials

[default]
aws_access_key_id = XXXXXXXXXXXXXXXXXXXX
aws_secret_access_key = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Note: This project uses the AWS SDK for NodeJS. https://aws.amazon.com/sdk-for-node-js/

For more information on generating credentials, see: https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/getting-your-credentials.html

3) Tag the AWS volumes you would like to manage

Use the key name of Snapshot and add a value representing the number of days you would like the snapshot to be retained.

For example, if you would like a snapshot to be retained for 10 days, add a tag with a key name of Snapshot and a value of 10.

Run it

ec2snapshots <region>

Separate multiple regions by commas.

ec2snapshots us-west-1,us-west-2

Dry runs

If you would like to see what would happen, without creating or deleting any snapshots, you can use the --dryrun flag.

ec2snapshots --dryrun us-west-1
# OR
ec2snapshots -d us-west-1

Development

If you want to develop with the source, you can simply execute ./bin/ec2snapshots.js us-west-1 to test it.

If you would like to install it globally, based on your source, run the following from the project directory:

npm install . -g

This will replace the ec2snapshots executable with the latest from your current codebase.