Javascript configuration library to handle an application's configuration. Stores config to localstorage.
MIT License
Configurator is a config manager library for Javascript. It uses localStorage to store persistent configurations in the browser.
Include configurator.js in your html
<script src="configurator.js"></script>
Now, create a config object. The function takes two parameters :
var config= Configurator({sound:true,autoPlay:false,volume:60},['volume']);
//volume property will persist even after refreshes using localstorage.
//Set additional configuration options
config.set("shuffle",true,true);
.set takes three parameters:
var shuffleState = config.get('shuffle');
//Will get the value of the config option.
Since configurator stores the persistent config information in localstorage, you cannot clear localstorage using localStorage.clear any more. Instead use config.clearLS()
function to clear the localStorage. It will clear localstorage, and write the persistent config keys back into localStorage.
Licensed under the MIT License. See LICENSE file for details.
Configurator is extracted from SDSLabs Muzi, a music player application for the IIT-Roorkee Campus.