Skip to content

Get an event everytime something is written / read / deleted using levelup. In includes streams support as well.

License

Notifications You must be signed in to change notification settings

mafintosh/level-events

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

level-events

Get an event everytime something is written / read / deleted using levelup. In includes streams support as well.

npm install level-events

build status dat

Usage

var events = require('level-events')

events(db) // db is a levelup instance
  .on('read', function(key, value) {
    console.log('[read]', key, value)
  })
  .on('write', function(key, value) {
    console.log('[write]', key, value)
  })
  .on('delete', function(key) {
    console.log('[delete]', key)
  })

db.put('hello', 'world', function() {
  db.createReadStream().resume()
})

Running the above example will print something like

[write] hello world
[read] hello world

License

MIT

About

Get an event everytime something is written / read / deleted using levelup. In includes streams support as well.

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published