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

@pattern-js/mod-vault

v0.2.2

Published

Encrypted-at-rest secrets for Pattern: AES-256-GCM vault (master key from PATTERN_VAULT_KEY), a vault.read node whose values are masked out of run samples, and a write-only Secrets screen in the admin.

Downloads

1,068

Readme

@pattern-js/mod-vault

Encrypted-at-rest secrets for Pattern — an AES-256-GCM vault that keeps secrets out of your observability: any value read from the vault is registered with the engine's sample mask, so it can never appear in sampled run I/O.

npm install @pattern-js/mod-vault

When to use / when not

A plain env var (a .env next to pattern.config.json is auto-loaded) is fine for local dev. Reach for the vault when you want secrets that:

  • survive without redeploying — written through the admin UI at runtime;
  • stay out of traces — vault reads are masked to •••, env vars are not;
  • live encrypted on disk rather than in plaintext in a .env.

It is not a place for non-secret config, and not a multi-key KMS — one master key for the whole vault.

Config

Defaults are fine for most setups; the one thing you must supply is the master key.

{ "mods": ["@pattern-js/mod-vault"] }

To move the database or pass the key explicitly, export a local wrapper mod:

import { vaultMod } from "@pattern-js/mod-vault";

export default vaultMod({
  storage: "./.pattern-data/vault.db",      // or "memory"
  masterKey: process.env.PATTERN_VAULT_KEY, // default; usually leave it
});

The master key

openssl rand -base64 32        # generate ONCE
# .env (gitignored, auto-loaded):
# PATTERN_VAULT_KEY=<the generated value>

The same key forever decrypts the vault. Without it the vault loads locked (reads/writes fail with a setup hint); lose it and the ciphertext is unrecoverable, so back it up where you keep other root secrets.

Read secrets in a workflow with vault.read; write them on the admin's System → Secrets page. The headline pairing is @pattern-js/mod-agents, which falls back to a vault secret named OPENAI_API_KEY with no node wired at all.

Full documentation: the Vault chapter at /docs (served by @pattern-js/mod-docs), or the source.