{"name":"level-live-stream","version":"1.4.7","homepage":"https://github.com/dominictarr/level-live-stream","repository":{"type":"git","url":"git://github.com/dominictarr/level-live-stream.git"},"dependencies":{"pull-stream-to-stream":"~1.2.4","pull-level":"~1.1.6"},"devDependencies":{"level-sublevel":">=4.0.2","level-test":"~1.4.0"},"scripts":{"test":"set -e; for t in test/*.js; do node $t; done"},"author":{"name":"'Dominic Tarr'","email":"dominic.tarr@gmail.com","url":"http://dominictarr.com"},"license":"MIT","description":"Stream live changes from levelup.","bugs":{"url":"https://github.com/dominictarr/level-live-stream/issues"},"_id":"level-live-stream@1.4.7","dist":{"shasum":"2213399a4297f15a176657e1ef24d2894ff3ede3","tarball":"http://registry-npm.ywwl.com/level-live-stream/download/level-live-stream-1.4.7.tgz","integrity":"sha512-9itMIqYWN+B4c69B7MtrBcgdqdW9stAD35bAZN+rsrcu/qdPpD2vMEGAOcwiduCTNs7xmzWSURhR8rt9HcSNTw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBt1ycZ9E8gg5xAf/dzAlk99WJXZgOg2DbtrH7RKR1iLAiBFmssg9613EuQ1JNxpU9IltB3ZKvig/lJ0p8XpnCBB9A=="}],"size":2503,"noattachment":false,"key":"/level-live-stream/-/level-live-stream-1.4.7.tgz"},"_from":".","_npmVersion":"1.3.6","_npmUser":{"name":"dominictarr","email":"dominic.tarr@gmail.com"},"maintainers":[{"name":"dominictarr","email":"dominic.tarr@gmail.com"}],"directories":{},"readme":"# level-live-stream\n\nStream live changes from levelup.\n\n[![Build Status](https://travis-ci.org/dominictarr/level-live-stream.png?branch=master)](https://travis-ci.org/dominictarr/level-live-stream)\n\nWorks just like [LevelUp#readStream](https://github.com/rvagg/node-levelup#readStream)\nexcept instead of ending, it will stay open and stream changes to the database as they are inserted!\n\nJust like the couchdb changes feed, but for any arbitrary range of keys!\n\nsee also, [level-livefeed](https://github.com/Raynos/level-livefeed/) for the same idea, \nbut with a [streams2](https://github.com/isaacs/readable-stream) api.\n\n``` js\n\nvar level = require('level')\n\nlevel('/tmp/level-live-stream', \n  {createIfMissing: true}, function (err, db) {\n\n  var liveStream = require('level-live-stream')(db)\n\n  liveStream\n    .on('data', console.log)\n\n  setInterval(function () {\n    db.put('time', new Date().toString())\n\n  }, 1000)\n\n})\n\n```\n\nYou can also attach `liveStream` as a method to the db like below.\nThis will allow [multilevel](https://github.com/juliangruber/multilevel)\nclients to use `db.liveStream()`.\n\n```js\nvar LiveStream = require('level-live-stream');\n\n// attach the `liveStream` method using `install`\nLiveStream.install(db);\n\n// then invoke the method using the `db` instance\ndb.liveStream()\n  .on('data', console.dir);\n```\n\n## options\n\n``` js\nLiveStream(db, {\n  tail: true,   //follow\n  old : true,   //get old records from data base\n                //if old=false you will only get live updates\n  min : loKey,  //lowest key in range\n  max : hiKey,  //highest key in range\n  reverse: true //stream in reverse (only applies to old records)\n})\n```\n\n## License\n\nMIT\n","publish_time":1375347617894,"_cnpm_publish_time":1375347617894,"dist-tags":{"latest":"1.4.13"}}