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

@forwardimpact/libconfig

v0.1.85

Published

Environment-aware application settings — services and CLIs load configuration without custom plumbing.

Readme

libconfig

Environment-aware application settings — services and CLIs load configuration without custom plumbing.

Getting Started

import { createConfig, createServiceConfig } from '@forwardimpact/libconfig';

const config = await createServiceConfig('myservice', { port: 3000 });

Bootstrap

A product's init verb hands its starter material to bootstrapProject, which writes config/config.json and .env under namespace-scoped ownership semantics. Same-key-same-value writes are no-ops; same-key- different-value writes refuse without explicit overwrite intent, so two products with disjoint top-level namespaces can converge against the same target directory.

import { bootstrapProject } from '@forwardimpact/libconfig';

await bootstrapProject({
  target,                              // absolute path; defaults to process.cwd()
  fragment: {                          // top-level keys are product-owned namespaces; {} or omitted is allowed
    product: {
      guide: { systemPrompt: '…' },    // fit-guide's slice under top-level `product`
    },
    service: {
      mcp:   { systemPrompt: '…' },    // fit-guide's slice under top-level `service`
    },
  },
  env: {                               // .env entries; {} or omitted is allowed
    SERVICE_SECRET: '…',
    MCP_TOKEN:      '…',
  },
  overwrites: {                        // explicit overwrite intent, partitioned per file
    config: ['product'],               // top-level namespace names (single segment)
    env:    ['MCP_TOKEN'],             // bare keys
  },
});
  • Entry pointbootstrapProject({ target, fragment, env, overwrites }). Returns void on success; throws a refusal Error whose cause carries { kind, path, overwriteSurface } when a write conflicts and the caller did not signal overwrite intent.
  • Namespace declaration — the top-level keys of fragment are the namespaces a product owns. Use the nested form ({ product: { guide: … } }) — that's the shape the libconfig reader resolves and the shape every in-tree caller emits. Cross-namespace writes (different top-level keys, or disjoint sub-keys under a shared top-level) never collide; within a namespace, any leaf disagreement refuses with a leaf-path diagnostic.
  • Overwrite intent — pass overwrites.config: [topLevelKey] (single- segment names) or overwrites.env: [bareKey] to opt in to replacing a conflicting value. The refusal message names both the conflicting leaf path (e.g. product.guide.systemPrompt) and the surface; the overwrite-intent entry remains the top-level key (product) — forgiving a single leaf forgives the whole namespace by design, so pick the smallest top-level that contains the disputed leaf.
  • .env primitivesbootstrapProject delegates per-key .env writes to @forwardimpact/libsecret's updateEnvFile, which preserves comment lines, the trailing newline, and mode 0o600.

bootstrapProject always materialises target/config/config.json (writing {} when fragment is empty and the file is absent) so subsequent reader invocations anchor locally rather than upward-walking into an ancestor config/. .env is created only when at least one entry is supplied; an empty env against an existing .env is a no-op.