JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 11
  • Score
    100M100P100Q49085F
  • License MIT

Package Exports

  • level-trigger

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (level-trigger) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

level-trigger

Triggers for levelup.

<img src=https://secure.travis-ci.org/dominictarr/level-trigger.png?branch=master>

Jobs must be idempotent! If the process crashes before job has calledback, it will be rerun the next time it's started, for consistency!

Example

var trigger = require('level-trigger')
trigger(db)

db.trigger.add({
  name: 'example',
  start: 'A', end: '~',
  mapKey: function (key) {
    //optionally index the job with a different key.
    //if there are two jobs with the same key,
    //it will only be triggered once.
    return key
  },
  job: function (value, done) { 
    //call done when job is done.
    done()
  }
})

License

MIT