0.0.1 • Published 9 years ago
dir-config-loader v0.0.1
#dir-config-loader
This is a simple config loader that loads all the yml and json files from a folder and outputs into a structure, and reloads on SIGHUP signal
##Usage
npm install --save dir-config-loader
For example, you have the following folder structure
config/config.yml
some: config
config/folder/config.json
{
"some": "json"
}
import Configurer from "dir-config-loader";
Configurer.load("./config").then((configurer) => {
console.log(configurer.configs.config.some) // config
console.log(configurer.configs.folder.config.some) // json
});
##SIGHUP
kill -SIGHUP [pid]
all the configs will be cleared and reloaded based on the previous folder.
0.0.1
9 years ago