{"_id":"sl-config-loader","_rev":"74-7293175a3a176c28d08a119f672b8cd9","name":"sl-config-loader","dist-tags":{"latest":"0.0.3"},"versions":{"0.0.1":{"name":"sl-config-loader","version":"0.0.1","_id":"sl-config-loader@0.0.1","maintainers":[{"name":"faisal","email":"faisal@faisal.com"}],"dist":{"shasum":"8e9376c8e9f1cc60c858975f03d083efa32d0eba","tarball":"https://registry.npmjs.org/sl-config-loader/-/sl-config-loader-0.0.1.tgz","integrity":"sha512-QIlFAIiHLj4RrcuwZWNpAPcoKLyoaENNFOH6uhkrruCrj3JjuRd8yylWbVafnKCJMotVU8qsJ+q7l0ilIPRb7Q==","signatures":[{"sig":"MEQCIEubURwvfyn4wn/F7PU19m7PJZEDnsMzY+yREdxqxCFRAiAKTEsK0tSVvLR+AYWYB1JrQOVmN32jhxYkmQWwhi7yHg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":"sl-config-loader","scripts":{"test":"mocha"},"_npmUser":{"name":"faisal","email":"faisal@faisal.com"},"_npmVersion":"1.2.21","description":"sl-config-loader","directories":{},"dependencies":{"debug":"latest","deepmerge":"~0.2.5","sl-task-emitter":"git+ssh://git@github.com:strongloop/sl-task-emitter"},"devDependencies":{"mocha":"latest"}},"0.0.2":{"name":"sl-config-loader","version":"0.0.2","_id":"sl-config-loader@0.0.2","maintainers":[{"name":"faisal","email":"faisal@faisal.com"},{"name":"strongloop","email":"callback@strongloop.com"},{"name":"ritch","email":"skawful@gmail.com"}],"dist":{"shasum":"3a713389ec0a6820bf44decc0f19c06ddd4dcf1d","tarball":"https://registry.npmjs.org/sl-config-loader/-/sl-config-loader-0.0.2.tgz","integrity":"sha512-QIpgZdgP41SeaIC0rjCiQJ9Xm2SuyaIAjqbhTKmT9+7kpS5LF6kyKDW1c8zu0POhnQ29qkYjsv9XzQLG2w6IXg==","signatures":[{"sig":"MEUCIC3bRcz4FlxgOKYDbe9DfU00D9p1B1zLIR0+eL4/SbPlAiEAwWGkewOI49t3VL74cZmIHV4v+ZOBXwECY9LhdhNNUOA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":"sl-config-loader","scripts":{"test":"mocha"},"_npmUser":{"name":"faisal","email":"faisal@faisal.com"},"_npmVersion":"1.2.21","description":"sl-config-loader","directories":{},"dependencies":{"debug":"latest","deepmerge":"~0.2.5","sl-task-emitter":"git+ssh://git@github.com:strongloop/sl-task-emitter"},"devDependencies":{"mocha":"latest"}},"0.0.3":{"name":"sl-config-loader","version":"0.0.3","license":"Apache 2","_id":"sl-config-loader@0.0.3","maintainers":[{"name":"faisal","email":"faisal@faisal.com"},{"name":"strongloop","email":"callback@strongloop.com"},{"name":"ritch","email":"skawful@gmail.com"}],"dist":{"shasum":"28350e3ceeeb9180cc1f5409037f6d5e92226940","tarball":"https://registry.npmjs.org/sl-config-loader/-/sl-config-loader-0.0.3.tgz","integrity":"sha512-5AD51J/NZL0VMtDItfKIAdolKPX5EeK+o+NF0qpN1lMfVdnPWHhdt6wGo1te1mRqPVV6RcpfUinQpFNxXS7V1Q==","signatures":[{"sig":"MEUCIGViJylrVVs5cMcWhQC7iNjihggbDuSlGeqBH7jmIpt5AiEA8pPZJkMzU45A+Wh007009u0ODQsMwoRQh3jdD5NoNRQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","scripts":{"test":"mocha"},"_npmUser":{"name":"ritch","email":"skawful@gmail.com"},"repository":{"url":"http://github.com/strongloop/sl-config-loader.git","type":"git"},"_npmVersion":"1.2.15","description":"recursively load config files","directories":{},"dependencies":{"debug":"latest","deepmerge":"~0.2.5","sl-task-emitter":"0.0.x"},"devDependencies":{"mocha":"latest"}}},"time":{"created":"2013-05-20T00:25:39.365Z","modified":"2026-04-14T15:16:03.097Z","0.0.1":"2013-05-20T00:25:40.645Z","0.0.2":"2013-05-20T23:26:13.192Z","0.0.3":"2013-06-07T18:19:20.379Z"},"license":"Apache 2","repository":{"url":"http://github.com/strongloop/sl-config-loader.git","type":"git"},"description":"recursively load config files","maintainers":[],"readme":"# sl-config-loader\nv0.0.1\n\n## Install\n\n    slnode install sl-config-loader\n    \n## Example\n\nGiven a nested structure of directories and config files:\n\n    /my-project\n      config.json\n      /my-resource\n        config.json\n        /my-sub-resource\n          config.json\n\nThe `sl-config-loader` recursively loads and caches all `config.json` files.\n\n    var ConfigLoader = require('../');\n\n    var options = {\n      'filename': 'config.json', // default config.json\n      'envFile': 'config.env.json', // default config.env.json\n      'envVar': 'NODE_ENV', // default NODE_ENV\n      'ignore': ['images', '.git', /\\^.*+/], // default null\n      'ttl': 3600 // in seconds, default 3600\n    };\n\n    var configLoader = ConfigLoader.create('path/to/project/root', options);\n\n    configLoader.load(function (err, config, cache) {\n      Object.keys(config).forEach(function (path) {\n        // config.json at the given path\n        console.log(config[path]);\n      });\n    });\n\n    \n## Usage\n\nLoad config files recursively and return them in a dictionary. Each config is keyed by the path of its parent directory.\n\n## Env File\n\nOverrides the config based on the current `NODE_ENV`.\n\n## Runtime Consistency\n\nIt is safe/performant to call `ConfigLoader.load` during http requests and other latency sensitive operations.\n\nThe `sl-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).","readmeFilename":"README.md","users":{"scottkay":true,"fgribreau":true}}