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

@procedures/env

v0.47.2

Published

Environment variables as procedures: one variable, the names, and the check of the required ones, with the secrets masked.

Readme

@procedures/env

npm

npm install @procedures/env

Environment variables as procedures: one variable, the names, and the check of the necessary variables. The procedures mask each secret.

The procedures

| Procedure | What it does | Effects | |---|---|---| | env.get | It gives one variable. A secret is masked unless the host reveals it. | reads process | | env.list | It gives the names, sorted. With values: true, it also gives the values of the variables that are not secrets. | reads process | | env.check | It gives the necessary variables that are missing and the variables that are present. | reads process |

  • Each procedure declares reads: ["process"] and writes: []. It changes nothing.
  • A masked secret has masked: true and no value. The output tells that the variable is set, and nothing about the value.
  • env.list does not give the value of a secret, also when the host reveals secrets to env.get.
  • env.check gives names only. An empty value counts as missing, unless the input has allowEmpty: true.
import "@procedures/env/register";

await client.call(["env", "check"], { required: ["DATABASE_URL", "GITHUB_TOKEN"] });
// { ok: false, missing: ["DATABASE_URL"], present: ["GITHUB_TOKEN"] }

Secrets

A secret is a variable whose name matches a pattern. The default patterns are *_TOKEN, *_KEY, *_SECRET and *PASSWORD*.

  • The * of a pattern matches each sequence of characters. The other characters match only themselves.
  • The comparison ignores the case, because Windows ignores the case of the names.
  • A variable can hold a password, but its name can match no default pattern. The host adds that name to secretPatterns, for example DATABASE_URL.

createEnvModule() gives the same procedures with other settings:

import { createRegistry } from "@procedures/client";
import { createEnvModule } from "@procedures/env/module";

const registry = createRegistry(createEnvModule({ secretPatterns: ["DATABASE_URL"], revealSecrets: ["NPM_TOKEN"] }));

| Option | Meaning | |---|---| | secretPatterns | More patterns of secret names, after the default patterns. | | revealSecrets | The secrets whose value env.get gives: true for each secret, or a list of names. The default is none. | | env | The variables: a record, or a function that gives them at each call. The default is process.env. |

Not MCP tools

These procedures are not MCP tools, and a bundle of tools does not include them.

  • A value that a tool gives goes to the model and to its provider. A variable can hold a key, a password or a private path.
  • The names of the variables also tell about the computer and its accounts.
  • A host that needs a check of its configuration starts env.check itself, before it starts its tools.

Tests

pnpm --filter @procedures/env test examines the procedures with a record of variables and with process.env. The tests examine the patterns, the masks, the reveal rule and the effects.