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',
});
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