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

@0disoft/universal-config-engine-node

v1.3.0

Published

Node.js JSON file, dotenv file, process env, and argv sources for Universal Config Engine.

Readme

@0disoft/universal-config-engine-node

Bounded Node.js source adapters for Universal Config Engine. The package provides JSON file, simple dotenv file, process environment, and argv sources while keeping filesystem and process APIs outside the core package.

Install

npm install @0disoft/universal-config-engine-core @0disoft/universal-config-engine-node

Node.js >=24 and ESM are required.

Application Declaration API (1.3)

loadConfig({ configPath, validatorFactory? }) applies declaration profiles, source loading, coercion, resource limits and validation through the same execution path as the CLI. loadValidatedConfig({ ...options, outputValidator }) additionally returns separate typed application output. Neither requires importing the CLI. Supply createAjvValidator from the optional Ajv adapter when declaring schemas; missing factories fail explicitly. See the application loading contract.

Process Environment Source

import { resolveConfig } from "@0disoft/universal-config-engine-core";
import { createProcessEnvSource } from "@0disoft/universal-config-engine-node";

const envSource = createProcessEnvSource({
  descriptor: {
    id: "env",
    kind: "process-env",
    priority: 20,
    displayName: "environment"
  },
  env: process.env,
  mappings: [
    {
      externalName: "APP_PORT",
      sourceKind: "process-env",
      targetPath: ["service", "port"],
      parseAs: "number"
    }
  ]
});

const result = resolveConfig({ sources: [envSource] });
console.log(result.config.service.port);

File Sources

loadJsonFileSource and loadDotenvFileSource enforce byte limits. Set allowedRootPath to bind file loading to a canonical directory; the loader verifies the opened file identity before reading it. The dotenv parser is intentionally simple and does not perform shell expansion.

JSON source locations also have an independent maxLocationBytes budget (default 4 MiB of compact UTF-8 location records). If exceeded, the loader preserves parsed config values, omits location metadata and returns a max_location_bytes_exceeded warning. This option does not replace file byte or structural depth/key limits and is not a total JavaScript heap limit.

Process-env and argv adapters use explicit mappings and bounded entry counts. Strict unmapped-input diagnostics are opt-in.

See the compatibility contract and public API contract.

Additional File Formats (1.3)

loadConfigFileSource({ descriptor, filePath, format }) adds explicit jsonc, yaml, toml and json5 loading through the existing bounded file boundary. Use descriptor kind adapter for dialect sources. JSONC trailing commas require allowTrailingComma: true. YAML aliases/custom tags and TOML date/time objects are rejected; all values must fit the normalized JSON object contract. Parser errors never include raw exception text. YAML/TOML/JSON5 failures include a fixed reason and one-based line/column when available, without source snippets or key names. These additions require version 1.3 or later. See the format contract.

Automatic Config Watching (1.3)

watchConfig({ configPath, workspacePath, ...loadingOptions }) automatically tracks declarations, inherited declarations and selected-profile file sources. It updates bounded subscriptions on reload, retains the last good config and repair subscriptions after failure, and releases obsolete watches after success. Call watched.watcher.close() during shutdown. Environment/argv updates require manual refresh. This API requires version 1.3 or later. See the reload contract.

License

MIT