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

meldkit

v0.1.2

Published

Typed YAML configuration loading with includes, deterministic merging, and required environment placeholders.

Readme

Meldkit

Typed YAML configuration for Node.js, with recursive includes, predictable merging, required environment placeholders, and caller-owned runtime validation.

Meldkit owns configuration composition. Your application owns the schema and the decision about which values are secrets.

Install

npm install meldkit

Meldkit is an ESM-only library for Node.js 24 and newer. It includes and re-exports Zod for the recommended runtime-validation boundary, while loadConfig also accepts any synchronous object with a compatible parse(value) method.

Quick start

Commit non-secret defaults in YAML:

# config/base.yaml
server:
  host: "127.0.0.1"
  port: 4000
log:
  level: "info"
database:
  host: "database.example.test"
  password: "${DATABASE_PASSWORD}"

Override only the local differences:

# config/local.yaml
include: "./base.yaml"
log:
  level: "debug"

Define and load the typed contract:

import { loadConfig, z } from "meldkit";

const ConfigSchema = z.object({
  server: z.object({
    host: z.string().min(1),
    port: z.number().int().positive(),
  }),
  log: z.object({
    level: z.enum(["debug", "info", "warn", "error"]),
  }),
  database: z.object({
    host: z.string().min(1),
    password: z.string().min(1),
  }),
});

export const config = loadConfig({
  path: "./config/local.yaml",
  schema: ConfigSchema,
});

The result is inferred from the schema. Meldkit reads configuration synchronously at startup and never mutates process.env. When env is omitted, Meldkit snapshots process.env automatically.

In-memory YAML

Use loadConfigText when YAML already comes from a caller-owned source, such as a test fixture or migration tool:

import { loadConfigText, z } from "meldkit";

const config = loadConfigText({
  env: { DATABASE_PASSWORD: "fixture-value" },
  schema: z.object({
    database: z.object({
      host: z.string().min(1),
      password: z.string().min(1),
    }),
  }),
  text: `
    database:
      host: database.example.test
      password: "\${DATABASE_PASSWORD}"
  `,
});

The text loader parses one document and does not access the filesystem. A root-level include fails; use loadConfig with a path when configuration inherits another file.

Includes and merging

include is allowed only at the YAML document root and points to one file relative to the file containing it. Includes may be recursive.

  • The included document is the base.
  • The including document is the override.
  • Plain objects merge recursively.
  • Arrays, scalars, and null replace the base value.
  • Include cycles fail before validation.

Documents merge before environment placeholders resolve. An override can therefore replace a base branch containing placeholders that are no longer relevant.

Environment ownership

Meldkit never discovers or parses .env* files. Populate the process environment before starting the application with the tool that owns your secret workflow:

dotenvx run -f .env.local -- node dist/main.js
node --env-file=.env.local dist/main.js

See the official dotenvx -f documentation and Node.js --env-file documentation for their precedence rules.

GitVaulty can materialize a protected environment file before either command. Containers, CI, and production platforms should inject variables through their runtime secret boundary.

If env is omitted, Meldkit takes a snapshot of process.env at load time. Passing env supplies the complete environment map instead, which keeps tests and runtime adapters deterministic:

const config = loadConfig({
  env: { DATABASE_PASSWORD: "fixture-value" },
  path: "./config/local.yaml",
  schema: ConfigSchema,
});

Environment-file naming and precedence belong to the launcher, not Meldkit.

Environment placeholders

Use ${UPPER_SNAKE_CASE} in YAML string values. Missing and empty values fail with the variable name and configuration path, never the resolved value.

Optional placeholders such as ${?TOKEN} are intentionally unsupported. If a setting is optional, omit the YAML field and express optionality or a default in the schema:

const ConfigSchema = z.object({
  webhookSecret: z.string().min(1).optional(),
});

This keeps absence distinct from an empty string and prevents deployment mistakes from silently becoming valid configuration.

More documentation

License

MIT