UNPKG
dwaal
Version:
latest (0.2.0)
0.2.0
0.1.4
0.1.3
0.1.2
0.1.1
0.1.0
Key-value storage shared between processes
github.com/aholstenson/dwaal
aholstenson/dwaal
dwaal
/
example.js
10 lines
(8 loc)
•
254 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
const
Storage
=
require
(
'./'
);
const
storage =
new
Storage
({
path
:
'./data'
}); storage.
get
(
'test'
) .
then
(
v
=>
{
console
.
log
(
'Key is currently'
, v);
return
storage.
set
(
'test'
, v ? v +
1
:
1
); }) .
catch
(
err
=>
console
.
log
(
'Error occurred'
, err));