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

@baseworks/config

v0.1.1

Published

Lightweight layered config loader for CLI tools and services — TOML (default), YAML or JSON, per-file by extension, project-local over global.

Readme

@baseworks/config

A lightweight layered config loader for CLI tools and services. One call gives you config that merges a project-local file over a global one, in TOML (default), YAML, or JSON — the format is chosen per file by extension, so a project can override a global YAML with a local TOML.

~/.myapp/config.toml   (global)   ─┐
                                    ├─ deep-merge (local wins) ─▶ typed config
./.myapp/config.toml   (local)    ─┘

Quick start

import { createConfigManager } from '@baseworks/config'

interface AppConfig { db: string; tenants: string[] }

const cfg = createConfigManager<AppConfig>(
  'myapp',
  { db: 'file:./local.db', tenants: ['acme'] },   // defaults
  { format: 'toml', layered: true },
)

const { db, tenants } = cfg.load()   // defaults ← global ← local, deep-merged
cfg.patch({ db: 'libsql://…' })      // merge + persist to the active file

Where files live

| | path | |---|---| | global | ~/.{appName}/config.{ext} | | project-local | ./.{appName}/config.{ext} (cwd) |

  • layered (layered: true) — both files load and deep-merge; local wins.
  • single-file (default) — the first found (local, then global) wins.
  • save() writes to the local file if a local dir/file exists, else the global one; an existing file keeps its own format regardless of format.

API

createConfigManager<T>(appName, defaults, options?)ConfigManager<T>:

| member | purpose | |---|---| | load() | read config (merged in layered mode, else first found) | | save(cfg) | write to the active path | | patch(partial) | deep-merge partial values and persist | | clearLocal() | delete the project-local file | | writePath / globalPath / localPath | resolved absolute paths |

Options: format ('toml' | 'yaml' | 'json', default 'toml') · layered (default false).

Explicit-path helpers (no app-name convention):

import { loadConfigFile, writeConfigFile } from '@baseworks/config'

const c = loadConfigFile('~/.myapp/settings.yaml', { theme: 'dark' })
writeConfigFile('./out/config.toml', c)   // format inferred from the extension

deepMerge(base, override) is exported too, for merging config-shaped objects.

Formats

TOML via smol-toml, YAML via yaml, JSON built-in. The extension picks the parser; format only decides what a new file is written as.

Develop

pnpm test        # vitest
pnpm build       # tsup → dist