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

adon-config

v2.0.0

Published

This module is used for managing system configurations in cascading order.

Readme

adon-config

This module is used for managing system configurations in cascading order. It is able to load recursively load all the files in the folder and form the exact structure in the config object.

assuming you have a javascript config file with the following item in config/common

modules.export = {
  test: {
    something: 'eureka!'
  }
}

you can retrieve them easily by

let config = require('adon-config').load(); //this should be one of the first line of code in your index file

config.load(__dirname);
console.log("My test value is " + config.get('test.something'));

Goal of this module

  • Allows developers to manage configuration files in a common structure
  • Support a mix of common config file types (Javascript, JSON)
  • Allows overriding of configurations data on different module levels
  • Allows special configurations based on server environment (NODE_ENV)

Installation

$ npm install adon-config --save

Setup

  1. In your node project, create a "config/common" folder where you want all the config files to exist.
  2. (optional) create an "config/env" folder within as well to contain environment specific configurations.
  3. inside these config folder create any files (javascript or json)
root
  |-config
  |     |-common 
  |     |   |-server.js
  |     |   |-database.js
  |     |-env 
  |     |   |-development
  |     |   |   |-server.js
  |     |   |   |-test.js
  |     |   |-production
  |     |   |   |-server.js
  |-index.js

in the sample above, we have 2 configurations that will be common across all environments. The config object will contain the attributes or elements named 'server' and 'database' based on the config files.

let config = require('adon-config').get()
console.log(config.database.source); //outputs the source value from common/database

The env (environment) overrides common configurations and will rely on the systm's NODE_ENV value. in the sample above, any duplicate values in config.server (based from common/server.js) will be overridden by the environment version. any unique configuration that exists in an environment only exists for that environment (i.e. development/test.js)

Functions

###Load loads the config folder from the current project directory then returns the latest config object (this is the first code you must trigger to initialize this module)

let config = require('adon-config').load()

just returns the latest config object and do nothing else (used for succeeding requests where loading of configurations are no longer needed)

let config = require('adon-config').get()

Dependencies

adon-config relies on the following node modules

  • [lodash] (https://github.com/lodash/lodash)

Source codes

adon-config is publicly available on Github

  • [https://github.com/adonisv79/adon-config] (https://github.com/adonisv79/adon-config)

License

GPL