Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
test rename modules from strong- to sl-, and increment version
.gitignore Update .gitignore Fix bad CLA URL in doc: add and Update
index.js rename modules from strong- to sl-, and increment version
package.json v0.0.6

DEPRECATED - strong-config-loader


slnode install strong-config-loader


Given a nested structure of directories and config files:


The strong-config-loader recursively loads and caches all config.json files.

var ConfigLoader = require('../');

var options = {
  'filename': 'config.json', // default config.json
  'envFile': 'config.env.json', // default config.env.json
  'envVar': 'NODE_ENV', // default NODE_ENV
  'ignore': ['images', '.git', /\^.*+/], // default null
  'ttl': 3600 // in seconds, default 3600

var configLoader = ConfigLoader.create('path/to/project/root', options);

configLoader.load(function (err, config, cache) {
  Object.keys(config).forEach(function (path) {
    // config.json at the given path


Load config files recursively and return them in a dictionary. Each config is keyed by the path of its parent directory.

Env File

Overrides the config based on the current NODE_ENV.

Runtime Consistency

It is safe/performant to call ConfigLoader.load during http requests and other latency sensitive operations.

The strong-config-loader is designed to load configuration that changes at runtime. To support this, the loader caches results for a specified ttl (time to live) and returns that result even if a config file has changed. Once the ttl runs out for a given config root, the loader checks the files last modified time (mtime) and compares it to the cache's last modified time. If the file has changed the new file is loaded from disk. The purpose of this complex checking is to support config loading in latency sensitive operations (eg. handling an http request).

Something went wrong with that request. Please try again.