nonfig

config module for node projects.

Usage no npm install needed!

<script type="module">
  import nonfig from 'https://cdn.skypack.dev/nonfig';
</script>

README

nonfig

适用于nodejs项目的轻量的多层配置读取模块。

NPM version

安装

npm install nonfig

配置

process.env.NODE_ENV = production/dev

项目结构:

/  
/dev.config.json  
/shop/  
/shop/dev.config.json  
/shop/index.js

/dev.config.json

{"a":1}

/shop/dev.config.json

{"b":2}

/shop/index.js

var config = require('nonfig')(__dirname);
// config : {"a":1,"b":2}

License

MIT