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

rc-toml

v2.0.0

Published

TOML based clone of dominictarr's `rc` module

Readme

rc-toml

TOML based clone of dominictarr's rc module

Usage

const rc = require('rc-toml')
// Read config
const config = rc('app')

// Find global config file
var { configFile } = rc.select(config)
// Otherwise default to $HOME/.apprc
if (configFile == null) configFile = rc.path('app')

// Write resolve config
rc.write(config, configFile)

API

const config = rc(name, [defaults = {}], [argv], [parse])

Returns a configuration object for app name, with defaults. argv is optional, and parsed by minimist by default. parse is applied to each configuration file, and defaults to @iarna/toml. Three special properties are applied to the final configuration:

  • configs is an array of defaults and of the parsed objects from files: [defaults, file1, ...]
  • configFiles is an array of the paths to the loaded configs
  • primaryConfig is the path to the highest precedence file

Configuration is loaded and merged in the following order (most to least important):

Process:

  • argv parsed by minimist (e.g. --foo baz, also nested: --foo.bar=baz)
  • env with ${APP_NAME}_ prefix
    • use __ to indicate nested properties (e.g. appname_foo__bar__baz => foo.bar.baz)
  • --config FILE (can be passed multiple times, with the in order of increasing precedence)
  • CONFIG=FILE exec

Local:

  • Recursive walking up the tree for .${APP_NAME}rc

Global:

  • Look in home directory for
    • .${APP_NAME}rc
    • .${APP_NAME}config
    • .${APP_NAME}/config
    • .config/${APP_NAME}
    • .config/${APP_NAME}/config

System:

  • Look systemwide
    • /local/usr/etc/${APP_NAME}.conf
    • /local/usr/etc/${APP_NAME}rc
    • /local/usr/etc/${APP_NAME}/config
    • /etc/${APP_NAME}.conf
    • /etc/${APP_NAME}rc
    • /etc/${APP_NAME}/config

const configFile = rc.select(config, [file = rc.select.GLOBAL])

Select the config from a specific file. Pass the parsed config as config and a predicate for selecting the file. Returns { config, configFile }, however configFile is null if no path matches the file predicate.

You can pass a string as file and it will match exact. You can pass null as file to select the highest precedence file.

rc.select.SYSTEM

Predicate for selecting the highest precedence file from the system group above.

rc.select.GLOBAL

Predicate for selecting the highest precedence file from the global group above.

rc.select.LOCAL

Predicate for selecting the highest precedence file from the local group above.

const path = rc.path(name)

Return the path to $HOME/.${APP_NAME}rc

rc.write(config, configPath, [stringify])

Write config to configPath with optiona stringify. stringify defaults to @iarna/toml. Ignores keys _, configs, primaryConfig, configFiles from config.

Install

npm install rc-toml

License

ISC