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

@bitxx/config-loader

v1.0.0-beta.1

Published

Bitxx Config Loader Library

Readme

@bitxx/config-loader

Type-safe configuration loading and validation for Node.js and TypeScript.

@bitxx/config-loader loads environment variables, discovers application configuration files, validates configuration values using @bitxx/validator, generates TypeScript configuration definitions, and provides type-safe access to nested configuration properties.

Installation

npm install @bitxx/config-loader @bitxx/validator

Using pnpm:

pnpm add @bitxx/config-loader @bitxx/validator

Using yarn:

yarn add @bitxx/config-loader add @bitxx/validator

Features

  • Environment variable loading from .env.
  • Automatic discovery of .js and .ts configuration files.
  • Type-safe configuration access through dot notation.
  • TypeScript configuration type generation.
  • Optional configuration validation.
  • Deep-frozen configuration objects.
  • Duplicate configuration name detection.
  • Worker-friendly configuration loading.

Quick Start

Project structure

my-app/
├── .env
├── configs/
│   ├── app.ts
│   └── database.ts
├── src/
│   └── index.ts
└── package.json

Environment variables

Create a .env file:

NODE_ENV=development
APP_PORT=3000
DB_HOST=localhost
DB_PORT=5432

Configuration file

Create configs/database.ts:

import { defineConfig } from "@bitxx/config-loader";

defineConfig({
  name: "database",
  values: {
    host: process.env.DB_HOST ?? "",
    port: Number(process.env.DB_PORT ?? 5432),
  },
  rules: {
    host: {
      required: true,
    },
    port: {
      required: true,
    },
  },
});

Initialize configuration

import { Load } from "@bitxx/config-loader";

Load();

Read configuration

import Config from "@bitxx/config-loader";

const appName = Config("app.name");
const port = Config("app.port");

console.log(appName, port);

API

  • Load() initializes the environment and loads configuration files.
  • LoadConfig() loads configuration files when APP_DIR is already initialized.
  • Config(path) retrieves a configuration value through a type-safe dot path.
  • defineConfig() registers named configuration values and optionally validates them.

Validation uses rules supported by @bitxx/validator. Failed validation throws an error.

License

MIT. See LICENSE.