userconfig

1.0.2 • Public • Published

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()
// => {}
```

Readme

Keywords

none

Package Sidebar

Install

npm i userconfig

Weekly Downloads

4

Version

1.0.2

License

ISC

Last publish

Collaborators

  • bdryanovski