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

confkit

v0.2.0

Published

Type-safe config and secure secrets for TypeScript runtimes.

Readme

confkit

npm license node

Type‑safe config. Secure secrets. One import.

Confkit provides a tiny runtime for defining, validating, and safely exposing configuration across Node, edge, serverless, Next.js, Vite, and Expo.

Quick Start

import { defineConfig, s, source } from "confkit";

export const config = defineConfig({
  sources: [source().env(), source().file("config.json")],
  schema: {
    NODE_ENV: s.enum(["development", "test", "production"]).default("development"),
    PORT: s.port().default(3000),
    DATABASE_URL: s.url(),
    PUBLIC_APP_NAME: s.string().client().default("confkit"),
    STRIPE_SECRET: s.secret(s.string()),
  },
  // Policy: enforce critical keys in production
  requiredProdKeys: ['DATABASE_URL', 'STRIPE_SECRET'],
});

// use it
const env = await config.ready();
console.log('PORT', env.PORT);

CLI

confkit help
confkit check --file conf/config.ts --env production
confkit print --file conf/config.ts --no-redact
confkit dev --file conf/config.ts
confkit init
confkit explain --key FOO
confkit doctor
confkit types --out confkit-env.d.ts
confkit ws check            # run check across all workspaces
confkit ws types            # generate types in each workspace

Docs

  • Overview, schema, sources, expansion: see the /docs directory in this repo.
  • Next.js, Vite, Expo integrations, and provider guides are under /docs/integrations/* and /docs/providers/*.

Monorepo Support

  • Zero‑config workspace discovery using package.json#workspaces (fallback to packages/* and apps/*).
  • Per‑workspace CWD handling so .env* and relative files are resolved inside each package.
  • New commands:
    • confkit ws check — validate every workspace that has conf/config.(ts|js)
    • confkit ws types — generate types per workspace (client or --server)
  • Flags: --root <path> (override root), --only <substring> (filter by name), --fail-fast, --server, --out <file>.

Tip: Running confkit without --file searches upward for the nearest conf/config.(ts|tsx|mjs|js) so you can run it from subfolders.

Notes

  • .env* files are ignored when NODE_ENV=production unless ALLOW_ENV_FILES_IN_PROD=true.
  • toJSON({ redact: true }) masks values marked with s.secret(...).
  • .client() marks keys safe to expose; loadConfig() computes clientEnv strings for bundlers.
  • Secrets are never allowed on the client. If a secret is marked .client() or uses a public prefix (e.g., PUBLIC_), Confkit throws.
  • Use requiredProdKeys to require specific keys when NODE_ENV=production.

Reference

  • Runtime API: packages/confkit/src/index.ts
  • Loader: packages/confkit/src/load.ts
  • CLI: packages/confkit/src/cli/index.ts