node-webhooks icon indicating copy to clipboard operation
node-webhooks copied to clipboard

Extend the persistence layer to support more DB

Open roccomuso opened this issue 9 years ago • 2 comments

API Example

var WebHooks = require('node-webhooks')
var InMemory = require('webhooks-memory-storage')
var FileStorage = require('webhooks-file-storage')

var webHooks = new WebHooks({
    db: new InMemory(),  // in-memory DB
    //db: new FileStorage('./webHooksDB.json'), // json file that store webhook URLs
    // redis, mongoDB, lokiJS, levelDB etc.
});

WebHooks Storage Implementation

Every webHooks store must be an EventEmitter and implement specific methods. The following methods are the list of required, recommended, and optional.

  • Required methods are ones that this module will always call on the store.
  • Recommended methods are ones that this module will call on the store if available.
  • Optional methods are ones this module does not call at all, but helps present uniform stores to users.

roccomuso avatar Aug 31 '16 09:08 roccomuso

I know this is years late, but i've started a fork using https://github.com/lukechilds/keyv

ccollie avatar Jan 14 '20 20:01 ccollie

@ccollie Feel free to PR here using keyv

roccomuso avatar Jan 28 '20 12:01 roccomuso