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

alohomora

v1.3.6

Published

✨ A cli that makes using AWS Parameter Store... as simple as the flick of a wand 🧙

Downloads

461

Readme

Table of Contents

About The Project

Many libraries deal with parameter store secrets. However, I didn't find one that suits my needs, so I created this one. I wanted to develop a library that will solve all my needs while using secrets, including exporting the key/secrets to different formats

Here's why:

  • Many solutions require prefixes to store keys, making it difficult to migrate when needed.
  • Support for exporting keys to widely accepted file formats such as JSON was limited.

Built With

Getting Started

Below is an example of instructions you can integrate into your own project's Getting Started section. You can follow these simple steps to get a local copy up and running:

Prerequisites

Installation

If you wish to use alohamora as a standalone utility:

npm -g install alohomora

This will make the alo command available in your terminal.

alo --help

If instead you would like to add it to a package:

npm install --only=dev alohomora

Usage

Every command accepts several options through command line or custom configuration see configuration for more

List secrets.

  alo list --prefix my-company/my-app

Get a secret.

  alo get SECRET_KEY_NAME --prefix my-company/my-app

Set/Update/Create a secret.

  alo set SECRET_KEY_NAME VALUE --prefix my-company/my-app --environment development

Delete a secret.

  alo delete SECRET_KEY_NAME --prefix my-company/my-app --environment production

Export secrets

  alo export json --prefix my-company/my-app --environment production

Configuration

You can configure alohomora from several places:

CLI options

  • Prefix (--prefix): The prefix used to store the keys (it should not start or end with a /, ex: if the path to the secret is /my-app/[env]/secretName, the prefix will be my-app )

  • AWS region (--aws-region): The AWS region code where the secrets will be stored (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html#concepts-available-regions)', default: us-east-1

  • Environment (--environment): It will be used to filter the secrets (production, staging, test, all), default: all

  • AWS Access Key ID (--aws-access-key-id): Credentials following https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/loading-node-credentials-environment.html

  • AWS Secret Access Key (--aws-secret-access-key): Credentials following https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/loading-node-credentials-environment.html

  • AWS Session Token (--aws-session-token): Credentials following https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/loading-node-credentials-environment.html

  • AWS Profile (--aws-profile): Following https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/loading-node-credentials-shared.html

  • CI flag (--ci): Removes colors to avoid odd input. default: false

If you are using alo as a global command, you can provide all the above options via command line:

  alo list --prefix my-company/my-app --aws-region us-west-2  --aws-profile myCustomAWSProfile --environment production

for more details you can invoke:

  alo --help

Custom Configuration

You can also define custom configuration in your package:

{
  "name": "my-package",
  "alohomora": {
    "prefix": "my-company/my-app",
    "environment": "production",
    "region": "us-west-2"
  },
  "scripts": {
    "secrets": "alo export"
  },
  "devDependencies": {
    "alohomora": "^1.0.0"
  }
}

When the command is invoked it will look for the alohomora configuration block.

(my-package)$ npm run secrets

Custom configuration can be defined in many places, for more information check cosmiconfig

notes about custom configuration

  • If prefix is provided via cli, the custom configuration will be ignored.
  • If configuration is provided via the cli, custom configuration will be merged with the provided cli configuration (except prefix)

example with overrides:

"alohomora": {
  "prefix": "my-company/my-app",
  "region": "us-west-2",
  "environment": "development",
}
  alo list --environment production

result: We will use everything from the custom configuration and use environment provided by the cli instead of the one on the custom configuration

example ignoring custom configuration:

"alohomora": {
  "prefix": "my-company/my-app",
  "region": "us-west-2",
  "environment": "development",
}
  alo list prefix "my-other-company/my-other-app"

result: We will ignore custom configuration given that prefix was provided via cli.

Roadmap

See the open issues for a list of proposed features (and known issues).

Contributing

Contributions are what makes the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.