0.0.1 • Published 9 years ago

dir-config-loader v0.0.1

Weekly downloads
3
License
ISC
Repository
-
Last release
9 years ago

#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.