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

professor

v0.1.1

Published

Easily run commands with a specific AWS profile.

Downloads

13

Readme

Professor

Processor is a happy little tool for doing things with AWS credentials. Using standard AWS config files, you can specify AWS keys in profiles and then use the professor to do any of the following:

  • Export AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY for a given profile.
  • Run a command with AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY set.
  • Print out a Redshift COPY command credspec (because I'm so sick of typing that out).

Also, this probably doesn't work in anything but bash, because the source script takes an argument.

Usage

$ npm install -g professor

This will get you two things:

  1. A script to source with a profile parameter to export keys to your current bash shell.
  2. A professor command.
Commands:
  run       Run a command with the given AWS profile
  credspec  Get a credspec suitable for passing into a Redshift COPY command
  source    Print the command you can use to source the professor

Options:
  -h, --help  Show help                                                [boolean]

Running with just one positional argument makes professor
spit out the access key and secret associated with the profile
named by that argument, for usage by the source script.

In order to use the fanciful just-export-my-creds feature, you need to setup an alias in your .bashrc or .profile file:

alias prof=$(professor source)

Now you can do prof default to export your creds! You can run professor source yourself to see what it does:

$ professor source
. /Users/Anthony/.nvm/versions/node/v0.12.2/lib/node_modules/profess/bin/professor

It simply prints out a source command that'll source our script. The alias makes it look like a normal command.

Using profess looks like this:

# Run with a profile called 'default'
$ professor run default someprogram some args

Profess gets these profiles via the node AWS sdk, and it sources them from ~/.aws/credentials. It expects a file format like this:

[default]
aws_access_key_id = something
aws_secret_access_key = somethingelse

[preview]
...

Enjoy!