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 🙏

© 2026 – Pkg Stats / Ryan Hefner

digistay-fetch-env

v1.0.1

Published

Generic AWS Parameter Store → .env materializer. Pulls /digistay/<env>/<app>/config and /secrets, merges .env.local, writes .env. No per-app logic — all config is data in Parameter Store.

Downloads

321

Readme

digistay-fetch-env

Generic AWS Parameter Store → .env materializer for DigiStay apps.

It pulls an app's config + secrets from AWS Parameter Store, merges any local overrides, and writes a single .env the app reads at startup. It knows nothing about specific apps, databases, or environments — all of that is data in Parameter Store. The script is ~40 lines of bash; this package just versions and distributes it.

What it does

/digistay/<env>/<app>/config    (String JSON, non-secret)   ┐
/digistay/<env>/<app>/secrets   (SecureString JSON, secret) � ──► merge ──► .env
.env.local  (your local overrides, wins on conflict)        ┘

Install

Per project (recommended for local dev):

pnpm add -D digistay-fetch-env

then in package.json:

{
  "scripts": {
    "env:local":   "digistay-fetch-env staging <app> .env",
    "env:dev":     "digistay-fetch-env staging <app> .env",
    "env:staging": "digistay-fetch-env staging <app> .env",
    "env:prod":    "digistay-fetch-env prod <app> .env"
  }
}

<app> is the Parameter Store app name (may differ from the repo name). env:local/env:dev pull staging until a sandbox dev namespace exists.

On a server (global):

npm i -g digistay-fetch-env
digistay-fetch-env staging <app> /home/ubuntu/<app>/.env

Usage

digistay-fetch-env <env> <app> <out-file>
  • <env>dev | staging | prod (selects the PS namespace; IAM-enforced)
  • <app> — the Parameter Store app name
  • <out-file> — where to write the merged .env

Local overrides — .env.local

Put only the keys you want to override (your local DB, localhost URLs) in a .env.local next to the output file. Every run merges with .env.local winning, and your overrides survive re-fetches. .env.local is yours — keep it gitignored, never commit it.

Requirements

  • aws CLI, configured (aws configure, region ap-south-1)
  • python3
  • The caller's IAM identity must be allowed to read the relevant /digistay/<env>/* parameters + kms:Decrypt.

Design

Generic by design — no per-app / per-db / per-env logic. Adding an app, a DB name, or a secret is a Parameter Store edit, touching zero code. Full database connection strings are stored as ordinary secrets. (Secrets-Manager-based rotation, if adopted, is resolved via a value template in the config blob — not by editing this script.)

MIT licensed.