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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@agilecustoms/envctl

v0.32.8

Published

node.js CLI client for manage environments

Readme

envctl

usage

terraform init -backend-config=key=laxa1986
envctl deploy -var-file=versions.tfvars -var="log_level=debug"
envctl delete

setup/update

npm install -g @agilecustoms/envctl # same command for update
envctl --version
npm outdated -g
npm view @agilecustoms/envctl version # show latest version available (without installing)

npmjs setup

  1. Login in npmjs.com
  2. Create organization "agilecustoms" this will create scope @agilecustoms (one org => exactly one scope, also scope can be created w/o org)
  3. Go to your user > Access Tokens > Generate New Token > Granular Access Token
    1. Token name: agilecustoms-ci
    2. Packages and scopes
      1. Permissions: Read and write
      2. Only select packages and scopes: @agilecustoms
    3. Organizations (keep as is)
  4. Save token in repo Settings > Environments > release > Environment secrets > Add environment secret
    1. Name NPMJS_TOKEN
    2. Repository access: envctl only

History/motivation

env-api is a microservice hosted in 'maintenance' account and working as garbage collector: every environment first created in env-api and then 'managed' by env-api: it deletes env when it is not in use anymore OR can extend lifetime. Creation API yields unique ID, so you can safely manage env (delete, extend lifetime) via this ID. But creation API needs to be secured. There are two main use cases:

  1. create an environment from CI (mainly ephemeral envs)
  2. create env from a dev machine

I (Alex C) have chosen IAM authorization as a common denominator:

  1. on CI — use OIDC to assume a role /ci/deployer
  2. on dev machine — use SSO and profile chaining to assume role /ci/deployer

Then as /ci/deployer --call--> env-api HTTP API (exposed with API Gateway with IAM authorizer)

Now the problem is: any request needs to be signed with AWS signature v4. Originally I planned to use bash scripts, but it quickly became bulky and hard to maintain. Then I thought about Node.js - it is available on dev machines and in GitHub actions (namely in Ubuntu runners). How to distribute it? First I thought about using ncc to bundle in one big .js file (as I do for publish-s3 and gha-healthcheck) but it will be hard to use on dev machine...

So I ended up publishing this client as an npm package in npmjs

  • CI environments can install it via GH action agilecustoms/envctl
  • developer will install it globally via npm install -g @agilecustoms/envctl

terraform init

Terraform init first time (given state configured to be in S3)

  1. backend state metadata
    1. terraform checks access to remote state (double-checked, tried to specify the wrong bucket, and it fails)
      • basically it tries s3:ListObjectsV2. But it looks like it does not check access to the file itself
    2. create file .terraform/terraform.tfstate with backend config (s3 bucket and key) (it does NOT download a state file itself!)
    3. so basically if you call terraform init two times with different keys, second time you get error "Backend configuration changed" and ask to migrate state or reconfigure
  2. modules (can be called individually via terraform get -update)
    1. download modules, put them in .terraform/modules
    2. modules are loaded before providers bcz in modules can be more providers!
  3. providers
    1. search for the latest provider satisfying conditions in .tf files
    2. download providers, put them in .terraform/providers/*
    3. create file .terraform.lock.hcl with provider versions and hashes