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

awsp-plus

v1.2.0

Published

Easily switch between and manage AWS CLI profiles

Downloads

21

Readme

AWSP Plus - Upgraded AWS Profile Switcher

Easily switch between AWS Profiles.

Expanded fork of awsp by johnnyopao with additional features and ongoing maintenance.*

* no guarantee expressed or implied.

How it works

The AWS CLI will use the profile present in the AWS_PROFILE environment variable, if no flag is set. This script parses the current aws profiles (~/.aws/config) and provides a filterable list, and then sets that environment variable based on your selection.

Prerequisites

Set up any number of profiles using the aws cli.

aws configure --profile PROFILE_NAME

You can also leave out the --profile PROFILE_NAME param to set your default credentials

Refer to the AWS CLI Documentation for more information: https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html

Setup

npm install -g awsp-plus

Add the following line to your .bashrc or .zshrc config:

alias awsp="source _awspp"

An alias is used because _awspp needs to be sourced to be able to modify the calling shell's environment variables.

Usage

Standard usage is just to call awsp and select a profile:

awsp

You can type to filter the list, or arrow through the shown options. Press <Enter> to select the highlighted option.

You can also type a profile with the command to immediately switch:

awsp development

This is equivalent to export AWS_PROFILE='development'.

Recommendation: Show your AWS Profile in your shell prompt

For better visibility into which AWS Profile is selected it's helpful to configure your prompt to show the value of the env variable AWS_PROFILE.

Examples

Here is a simplified example:

function aws_prof {
  local profile="${AWS_PROFILE:=default}"

  echo "aws:(${profile})"
}

PS1="$PS1 \$(aws_prof)"

Here's @johnnyopao's example using oh-my-zsh themes, with nice colors:

function aws_prof {
  local profile="${AWS_PROFILE:=default}"

  echo "%{$fg_bold[blue]%}aws:(%{$fg[yellow]%}${profile}%{$fg_bold[blue]%})%{$reset_color%} "
}

PROMPT='OTHER_PROMPT_STUFF $(aws_prof)'

A more advanced example for bash can be found in my dotfiles at https://github.com/abyss/dotfiles.

Contributing

Issues and pull requests are welcome. 😄

License

This project and the original work are licensed under the ISC License.

Copyright (c) 2021 Abyss

Original Work Copyright (c) 2020 Johnny Opao (@ https://github.com/johnnyopao/awsp)