forked from osirisguitar/sessitoken
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
36 lines (35 loc) · 861 Bytes
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
var FileStore = require('./lib/filestore');
var store = new FileStore();
store.set('abc123', 'foo', 'bar')
.then(function () {
console.log('set');
return store.update();
})
.then(function () {
console.log('saved to disk');
return store.get('abc123');
})
.then(function (entry) {
console.log('entry', entry);
return store.get('abc123', 'foo');
})
.then(function (value) {
console.log('value', value);
return store.del('abc123', 'foo');
})
.then(function () {
console.log('deleted');
return store.get('abc123', 'foo');
})
.then(function (value) {
console.log('value', value);
return store.clear('abc123');
})
.then(function () {
console.log('cleared');
return store.update();
})
.then(function () {
console.log('saved to disk');
})
.catch(console.error.bind(console));