userconfig
v1.0.2
Published
Store some user configuration inside his personal directory
Downloads
5
Readme
userconfig
Small fork of https://github.com/yeoman/configstore - but less simple version of it.
Install
$ yarn add userconfig
// or
$ npm install --save userconfig
QuickStart
Simple example
import UserConfig from 'userconfig'
const Config = new UserConfig('my-app-settings')
Config.set('user.profile.visible', true);
Config.get('user.profile.visible')
// => true
Config.has('user.profile.visible')
// => true
Config.delete('user.profile.visible')
Config.has('user.profile.visible')
// => false
// Force sync
Config.sync({ /* overwrite the data inside */ })
Config.keys()
// => [ 'user.profile', 'user.settings' ... `]
Config.all()
// { 'user.profile': '...', 'user.settings': '...' ... }
Config.clear()
// => {}
Config.truncate()
// => {}
```