UNPKG

node-config-yaml

Version:

Yaml Config for Node.js based on config-yml package

16 lines (13 loc) 399 B
'use strict' const path = require('path') const sh = require('shelljs') const decache = require('decache') module.exports = function (name) { decache('js-yaml') decache('yargs') // decache('../') delete require.cache[require.resolve('../')] sh.cp('-f', path.join(__dirname, 'configs', name + '.yml'), 'config.yml') const config = require('../').load() return config }