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

ec2-tool

v1.1.2

Published

a command line ec2 management tool

Readme

ec2-tool


alt text


Install

$ npm install -g ec2-tool
$ ec2 configure
  profile  (default) 
  region  (us-east-1) 
  access key id  "access_key"
  secret access key "secret_access_key"  
  ssh keys  

If you do not have an access key id or secret access key, go to security credentials in the amazon console to find or create a key pair. Note, however, you can still use commands requiring only ssh keys for operation without these.

Usage

$ ec2
NAME:
    ec2  -  Command-line interface to common ec2 operations.
USAGE:
    ec2 <command> [parameters]

COMMANDS:
  ls                   list ec2 instances
  ssh                  Connect to an ec2 instance via ssh.
  sftp                 Transfer files over sftp with an ec2 instance
  mount                Mount an ec2 instance locally via sshfs.
  umount               Unmount a locally mounted ec2 instance
  start                start existing ec2 instances
  stop                 stop existing ec2 instances
  terminate            terminate existing ec2 instances
  configure            Configure AWS credentials.
  help                 display help

OPTIONS

  --profile            The AWS profile to use.

Commands


configure

Configure default options.

 $ ec2 configure

  profile  (default) 
  region  (us-east-1) 
  access key id  "access_key"
  secret access key "secret_access_key"  
  ssh keys  

ls

Lists ec2 instances for the authenticated user.

          id             name     state        ip      

 i-0d9966ba6b5514c17   momo-0   stopped               
 i-07959805b54afece3   momo-1   stopped               
 i-04ff281642d0d308f   momo-3   stopped               
 i-04b9ceda681b36365   momo-2   stopped               
 i-0a7f1d50f8653146d  bootnode  stopped               
 i-0594c50d0368aae37   kidwai   running  34.206.87.14 

ssh

Open an ssh connection with an ec2 instance.

$ ec2 ssh -n kidwai

ubuntu@ip-172-31-27-62:~$ 

To use a keyfile not contained in the directory specified in the configuration file, use the -i flag as usual.

Execute a command remotely and return the output

$ ec2 ssh -n kidwai -c "df -h"
Filesystem      Size  Used Avail Use% Mounted on
udev            2.0G     0  2.0G   0% /dev
tmpfs           396M   41M  355M  11% /run
/dev/xvda1       49G   39G  9.5G  81% /
tmpfs           2.0G     0  2.0G   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           2.0G     0  2.0G   0% /sys/fs/cgroup
tmpfs           396M     0  396M   0% /run/user/1000

sftp

Open an sftp session with an ec2 instance.

$ ec2 sftp -n website
Connected to 39.252.82.0.
sftp> get -r /logs

mount

Mount the instance named "website".

 $ ec2 mount -n website
 Mounted 39.252.82.0 to /mnt/ssd/software/nodejs/ec2-tool/website

Mount the instance named "website" to a custom mount point.

$ ec2 mount -n website -m /mnt/website

umount

Unmount the instance named website

 $ ec2 umount -n website
Unmounted 39.252.82.0 from /mnt/ssd/software/nodejs/ec2-tool/website

start,stop,terminate

Start,stop, or terminate an ec2 instance.

 $ ec2 stop -n website
 $ ec2 start -n light
 $ ec2 terminate -i i-34b4b5b3b3

Profiles

Multiple profiles can be configured then supplied with '--profile':

$ ec2 configure 
 profile: (default)  test
 region:  (us-east-1) us-east-1
 access key id "access_key_id"
 secret access key "secret_access_key"


$ ec2 --profile test ssh -n test -c "ps aux | grep geth"
ubuntu     516  1.2 10.6 1965968 431152 ?      Sl   Jun23 313:17 geth --testnet --rpc --port 30304 --rpcport 8547 --password /dev/fd/63 --unlock 0
ubuntu    9497  0.0  0.0  11240  2940 ?        Ss   05:38   0:00 bash -c ps aux | grep geth
ubuntu    9499  0.0  0.0  12948   976 ?        S    05:38   0:00 grep geth