my-config-loader
v1.1.1
Published
Config file loader
Downloads
3
Maintainers
Readme
my-config-loader
Usage
Default config files
require('my-config-loader')('clam')
clam.config.js
.clamrc.js
.clamrc.json
.clamrc
package.json (package.clam)
API
// namespace
const loadConfigFile = require('my-config-loader')('clam');
// more options
const loadConfigFile = require('my-config-loader')('clam', {
cwd: process.cwd(),
returnFileName: false,
packageConfig: 'clamConfig'
configFiles: [
'clam.json',
'clam.config.js',
'.clamrc',
'package.json',
],
});
// load config file
const config = loadConfigFile();
const config = loadConfigFile(process.cwd()); // custom cwd
const config = loadConfigFile({ // custom config
cwd: process.cwd(),
packageConfig: 'myConfig'
});
const [config, file] = loadConfigFile({
returnFileName: true
});