config-singleton
v1.0.0
Published
common JS module that requires a JSON file and provides a mutable config singleton that can be required everywhere else
Maintainers
Readme
config-singleton
common JS module that requires a JSON file and provides a mutable config singleton that can be required everywhere else
Getting Started
1. Installation
npm install config-singleton2. Examples
// defaults.json
{
"defaultLanguage": "en"
}
// main.js
require('config-singleton').load('defaults.json');
// module.js
var config = require('config-singleton');
console.log("default language is %s", config.defaultLanguage);Copyright and license
Copyright (c) 2015, Any Code [email protected]
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
