user-appdata
v0.1.2
Published
Load and save user application data with ease.
Downloads
71
Maintainers
Readme
user-appdata
Load and save application data platform independent without additional configuration based on the current users system APP_DATA
folder.
Contructor parms
- appname (not optional) - A unique app name. Best one is the
name
property from yourpackage.json
. - filename (optional) - Default
config.json
. - defaultSettings (optional).
Methods
load()
save()
uninstall()
setConfigFilename(filename /* string */)
Example
var Config = require("app-userdata");
var config = new Config({appname : "myApp", defaultSettings : {"foo" : "bar"}});
console.log(config);
Yields on Microsoft Windows:
{
settings: {
foo: 'bar'
},
appName: 'myApp',
dataFolder: 'C:\\Users\\Stephan\\AppData\\Roaming\\myApp',
filename: 'C:\\Users\\Stephan\\AppData\\Roaming\\myApp\\config.json'
}