1.0.2 • Published 7 years ago

userconfig v1.0.2

Weekly downloads
1
License
ISC
Repository
-
Last release
7 years ago

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