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

envan

v1.0.0

Published

manage environment variables for AWS SSM Parameter Store

Downloads

110

Readme

envan

envan helps you sync env files from AWS SSM. Allows you to share your environment variables in a simple way when you have a team.

Features

  • Store and sync environment variables from AWS SSM Parameter Store.
  • Works with mono repo. (Currently, it only supports pnpm package managers for mono repo)
  • Works with CI/CD pipelines.
  • Works with AWS profiles.
  • Works with workspace mode.
  • Generate .env.example files.

Installation

npm i envan
yarn add envan
pnpm add envan

You can always run commands as cli tool or a npm or npx script inside a project. Add -g if you want to use envan globally.

Prerequisites

  • AWS credentials configured
    • Using AWS CLI
    • Or setup environment variables
      • AWS_ACCESS_KEY_ID
      • AWS_SECRET_ACCESS_KEY
      • AWS_REGION
  • AWS SSM Parameters created
  • AWS SSM Parameters must be in the following format:
    /<environment>/<service>/<key>
  • Add fields in package.json

Example:

{
  "envan": {
    "ssmPaths": {
      "dev": "/dev/<service-name>",
      "prod": "/prod/<service-name>"
    }
  }
}

Usage

Usage as CLI

Usage: envan [options] [command]

Sync .env files from AWS SSM Parameter Store

Options:
  -v, --version    output the current version
  -h, --help       display help for command

Commands:
  pull [options]   envan helps you sync env files from AWS SSM
  clean [options]  clean .env files
  help [command]   display help for command


Examples:
--------
Pull dev .env files from Parameter Store:
  $ envan pull
Pull prod params with AWS profile:
  $ envan pull -e prod -p my-profile
Pull with AWS profile and force overwrite:
  $ envan pull -e dev -p my-profile -f
Pull with specified aws profile and force overwrite in workspace mode:
  $ envan pull -e dev -p my-profile -f -w
Pull .env and generate .env.example in workspace mode:
  $ envan pull -e dev -w -eg
Clean .env files:
  $ envan clean
Clean .env and  .env.example files:
  $ envan clean -eg
Clean .env and  .env.example files in workspace:
  $ envan clean -w -eg

Usage as package

Load .env files to process.env:

const { loadEnv } = require("envan");

loadEnv();

CI/CD

You can use envan in your CI/CD pipeline to sync env files from AWS SSM Parameter Store. Configure AWS credentials in your CI/CD pipeline. And then you can use envan to sync env files.

Here is an example Github Actions Step:

    - name: Get .env files
        run: pnpm envan pull -e dev
        env:
          AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
          AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
          AWS_REGION: ${{ secrets.AWS_REGION }}

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT