node-webhooks
node-webhooks copied to clipboard
Extend the persistence layer to support more DB
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.
I know this is years late, but i've started a fork using https://github.com/lukechilds/keyv
@ccollie Feel free to PR here using keyv