larvitconf

0.1.80 • Public • Published

Build Status

larvitconf

larvitconf is configuration loading library that take options and load json files in to a json object.

Usage

let options = {
	'requiredFiles': [
		'configFile1.json',
		'/subFolder/configFile2.json',
		'/subFolder/subFolder2/configFile3.json'
	],
	'configFolder': '/srv/application/config/' // Optional
};

const config = await configLib.loadConfigs(options); // throws on error
console.log(config);

Code above returns a json object that look like this.

{
	configs: {
		configFile1: {},
		subFolder: {
			configFile2: {},
			subFolder2: {
				configFile3: {}
			}
		}
	},
	configFolder: '/srv/application/config/'
}

"configFolder" is optional and if not specified the lib will look in the folder where the process is run and in it's subfolder "config/"

Changelog

0.1.0

  • required_files => requiredFiles
  • config_folder => configFolder
  • Upped lib versions
  • Return promise instead of taking callback

Readme

Keywords

Package Sidebar

Install

npm i larvitconf

Weekly Downloads

284

Version

0.1.80

License

ISC

Unpacked Size

3.52 kB

Total Files

3

Last publish

Collaborators

  • lilleman
  • gagge
  • jaggu-snorr
  • jaggu-larvit-npm-publish