roccomuso / node-webhooks

:arrow_right_hook: Node.js module to create and trigger your own webHooks.
190 stars 47 forks source link

Extend the persistence layer to support more DB #4

Open roccomuso opened 7 years ago

roccomuso commented 7 years ago

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.

ccollie commented 4 years ago

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

roccomuso commented 4 years ago

@ccollie Feel free to PR here using keyv