Skip to content

Latest commit

 

History

History
30 lines (25 loc) · 447 Bytes

README.md

File metadata and controls

30 lines (25 loc) · 447 Bytes

oplog-stream

MongoDB oplog stream wrapper

Installation

  npm install oplog-stream

Usage

  var oplog = require('oplog-stream')
  
  oplog(function (err, stream) {
    if (err) {
      throw err
    }
    stream.on('data', function (data) {
      console.log(data)
    })
    stream.on('error', function () {
      throw err
    })
  })

Destroying stream

  stream.destroy() // also closes connection to db