@did-connect/storage-nedb
v2.2.4
Published
Storage engine that uses nedb for did-auth
Downloads
16
Readme
Introduction
DID Connect session storage engine that uses nedb to store data, implements interfaces defined in @did-connect/storage
.
Install
npm install @did-connect/storage-nedb
// or
yarn add @did-connect/storage-nedb
Usage
const { NedbStorage } = require('@did-connect/storage-nedb');
const storage = new NedbStorage({
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 sessionId = '123456';
const item = await storage.create(sessionId);
})();