@arcblock/did-auth-storage-nedb
v1.7.1
Published
Storage engine that uses nedb for did-auth
Downloads
1,578
Readme
Storage engine that uses nedb to store data, implements interfaces defined in
@arcblock/did-auth-storage
.
Table of Contents
Install
npm install @arcblock/did-auth-storage-nedb
// or
yarn add @arcblock/did-auth-storage-nedb
Usage
const DiskStorage = require('@arcblock/did-auth-storage-nedb');
const storage = new DiskStorage({
dbPath: '/path/to/db',
});
// Listen on events of the storage
storage.on('create', d => console.log('create', d));
storage.on('update', d => console.log('update', d));
storage.on('destroy', d => console.log('destroy', d));
(async () => {
const token = '123456';
const item = await storage.create(token);
})();
Contributors
| Name | Website | | -------------- | -------------------------- | | wangshijun | https://ocap.arcblock.io |