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

@fougere/adapter-env

v0.30.0-alpha.4

Published

The process environment as a source — MEILI_URL read as Meili's url, judged at boot.

Readme

@fougere/adapter-env

The process environment as a source — MEILI_URL is Meili's url

// entities/Meili.ts
export default class Meili extends entity({ url: url(), key: text(), timeoutMs: number({ integer: true, default: 2000 }) }) {}

// fougere.config.ts
import '@fougere/adapter-env';

export default defineFougere({
  sources: {
    main: { type: 'sqlite', path: '.data/app.db' },
    env: { type: 'env', values: ['Meili'] },
  },
});

// services/Search.ts
export default class Search {
  constructor(private meili: Meili) {}
}

Search receives { url, key, timeoutMs }, judged at boot. A variable that is missing, or that does not hold what its field declares, refuses the boot and names it:

meili.key: Required — sources.env, MEILI_KEY

The names

A field is read from ENTITY_FIELD, in SNAKE_CASE and with no prefix: timeoutMs is MEILI_TIMEOUT_MS. The text is read as the field's shape says — a number, a boolean (true, false, 1, 0), JSON for an object or a list — and what does not read that way is refused by the field.

Under rows:, a segment of the name is the key, read from the END, since the fields are known: INDEX_BOOKS_URL is the row books, INDEX_PROD_AUTHORS_URL the row prod_authors. Two fields that end alike — url and booksUrl — would read one variable two ways, and are refused when the storage is made.

What it does not do

Nothing is written: a write is refused, naming the variable to change. And it is never the source that holds the rest — a type that is read-only cannot be, so env beside main leaves main the default.

One environment per deployment, not a pattern inside it: production and staging are two processes, each started with its own variables. A value that differs by file is read from a directory the config computes:

config: { type: 'file', path: `config/${process.env.APP_ENV}`, values: ['Catalog'] },