dir-config-loader

0.0.1 • Public • Published

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.

Package Sidebar

Install

npm i dir-config-loader

Weekly Downloads

1

Version

0.0.1

License

ISC

Last publish

Collaborators

  • shekhei