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

uncfg

v0.0.2

Published

Just another configuration helper for Node.js.

Readme

UnCfg

Just another configuration helper for Node.js.

Features

  • Very simple, no tweaking. Give it your config folder and start working!
  • Supports env-specific settings. Make a folder with the env name, set your NODE_ENV variable and ready to go!
  • Supports calculated config, each config it's a normal .js file. Read process.env or do Math, you just have to give a value.

Usage

First, add the dependency to your package.json:

npm install --save uncfg

Then, require() it in your app, and make use of it:

// Require the package
const path   = require('path'), // miscellaneous
      config = require('uncfg');

// Load configuration from `config` directory
config.load(path.join(__dirname, 'config'));

// Read value (both are valid)
let port = config('port');
let port = config.get('port');

// Read nested value (both are valid)
let host = config('database.host');
let host = config.get('databse.host');

// Read value with default (only with `.get`)
let sample = config.get('a.b.c', 'its okay :D');

// Save value (both are valid)
config('hello', 'world');
config.set('hello', 'world');

// Get copy of store
let cfg = config();
console.log(cfg.hello); // world
console.log(cfg.port); // 3000
console.log(cfg.database.host); // localhost

The code above assumes your app is structured like this:

my-awesome-app
+-- app.js
+-- package.json
+-- config
|   +-- port.js
|   +-- database.js
|   +-- production
|   |   +-- database.js
+-- node_modules

If you need more guidance, feel free to check the tests, specifically in the config test folder.

Specific example

So you need even more examples? Ok, let's do it!

// config/database.js
module.exports = {
  hostname: 'localhost',
  database: 'ohmydear',
  username: 'notroot',
  password: 123456789
};

// config/production/database.js
module.exports = {
  url: 'mongodb://me:[email protected]/test'
};

// app.js
const path   = require('path'),
      config = require('uncfg');

config.load(path.join(__dirname, 'config'));

let dbCfg = config('database');
console.log(dbCfg); // { hostname: 'localhost',
                    //   database: 'ohmydear',
                    //   username: 'notroot',
                    //   password: 123456789,
                    //   url: 'mongodb://me:[email protected]/test' }
                    // *NOTE*: `url` is available if `NODE_ENV=production`.

let host = config('database.hostname');
let user = config('database.username');

License

This project is released under the MIT license.