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

icnf

v0.0.6

Published

a nodejs module for supporting simple configeration in json format

Readme

ICNF

icnf is a nodejs module for supporting simple configeration in json format (but powerfull).

License: GPL/BSD

Intro

There already exists a module named config, but for me, it is too large -- i dont want supporting yml etc features, i just want a simple solution but exactly have what i want.

So that's why i do this module. And of cause choice is yours.

How to install

npm install icnf

How to use

  1. create several config files under etc/ directory in your project, for example:

    <YOUR PROJECT>
    + etc/
      + production.json
      + testing.json
      + development.json
    		comm/   -- this contains comm settings for all of the environments, but still configerable
    			+ comm.json
    			+ comm2.json
  2. use icnf in your code

    var icnf = require('icnf')(__dirname);
    // app root directory, that is <YOUR PROJECT>
    
    var config = icnf(); 
    // default is process.env.NODE_ENV || 'production', so it will automatically choose etc/production.json.
    
    var config = icnf('development'); 
    // choose etc/development.json explicitly

How to use idiff

There is also a tool named idiff under bin/ above v0.0.3. This tool only check the key in the config file. For example:

$ idiff production
  checking /Users/yarco/Sites/js/icnf/test/etc/development.json
- database.port
- database.more.name
! database.more.port
- keywords.1

Argument production is the standard config file in this example. (That means you may treat that file as a standard.) This file should be located in etc/ (etc/production.json).

  • - means the key database.port is lost in development.json when comparing to production.json
  • ! means type does't match

Notice:

  • Array like keys (ex. keywords here) will always treat as an object.
  • Key exists in development but not in production will be totally ignored.
  • extend part won't be checked. cause it is used for common part

Here is development to production (you could also add more files there, ex. testing.json):

$ idiff development
  checking /Users/yarco/Sites/js/icnf/test/etc/production.json
- gf
- database.more.kk
! database.more.port

Extra notice

  • config file is <PROJECT>/etc/<ENV>.json, the name of etc is fixed
  • the directory for comm part is comm (<PROJECT>/etc/comm/<YOUR>.json), is also fixed
  • files in subdirectories under etc/ will be totally ignored when using idiff
  • You can use environment variable now (>= v0.0.5), just prefix with $, for example: { "NODE_ENV": "$NODE_ENV" }. $NODE_ENV will be expanded to its real value.

ChangeLog

  • 0.0.5 to 0.0.6
    • add supporting multi-confs in extend keyword, see example: test/etc/production.json , key extend
      • add key extendEnvValue in config if you want to disable checking environment variable
  • 0.0.4 to 0.0.5
    • add support for environment variables, the value prefix with '$' will be expanded. (that means "KEY": "$VALUE" will be treated as "KEY": process.env.VALUE )
  • 0.0.3 to 0.0.4
    • move repos from yarcowang/icnf to Yet-Another-Org/node-icnf
    • change a bit README
    • add default argument in idiff (so, it will default choose process.env.NODE_ENV || 'production' without type production
  • 0.0.1 to 0.0.3
    • add idiff
    • add extend feature for common part, see example under tests/

Contact

You could contact me through [email protected] according to further debugging or maintance. Programming related topics are also welcomed.

timezone: GMT+0800