key-store-util
v1.0.1
Published
```javascript const KeyStore = require('key-store-util'); const keyStore = new KeyStore(); ```
Downloads
7
Readme
Key Store Util
Usage
Initializing
const KeyStore = require('key-store-util');
const keyStore = new KeyStore();
Storing key
// default saving
keystore.saveKey('key1', 'value1');
// expired saving
keystore.saveKey('key2', 'value2', new Date('2020-01-01'));
// expired saving ( minutes )
keystore.saveKey('key3', 'value3', 3);
Getting value
// value
keystore.get('key1').value;
// key
keystore.get('key1').key;
// expire time
keystore.get('key1').expiredAfter;