{"_id":"level-logs","_rev":"237242","name":"level-logs","description":"Store multiple append only logs in leveldb.","dist-tags":{"latest":"1.2.0"},"maintainers":[{"name":"mafintosh","email":""}],"time":{"modified":"2023-03-24T16:33:59.000Z","created":"2015-01-31T18:51:56.712Z","1.2.0":"2017-06-29T08:48:57.168Z","1.1.2":"2016-10-23T09:45:45.492Z","1.1.1":"2016-10-23T09:37:15.044Z","1.1.0":"2015-03-04T16:04:42.167Z","1.0.0":"2015-01-31T18:51:56.712Z"},"users":{},"author":{"name":"Mathias Buus","url":"@mafintosh"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/level-logs.git"},"versions":{"1.2.0":{"name":"level-logs","version":"1.2.0","description":"Store multiple append only logs in leveldb.","main":"index.js","dependencies":{"lexicographic-integer":"^1.1.0","pump":"^1.0.0","through2":"^0.6.3","from2":"^1.3.0","stream-collector":"^1.0.1"},"devDependencies":{"memdb":"^0.2.0","standard":"^2.3.1","tape":"^3.5.0"},"scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/level-logs.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/level-logs/issues"},"homepage":"https://github.com/mafintosh/level-logs","gitHead":"271cbdf3c73b9763e810ce5fb8937f52517cfbc7","_id":"level-logs@1.2.0","_npmVersion":"5.0.3","_nodeVersion":"8.1.1","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"0f9d93845bed590ad4c2d698c0d4014f70a8541c","size":3198,"noattachment":false,"key":"/level-logs/-/level-logs-1.2.0.tgz","tarball":"http://name.csiicloud.com:7001/level-logs/download/level-logs-1.2.0.tgz"},"maintainers":[{"name":"mafintosh","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/level-logs-1.2.0.tgz_1498726136204_0.5961478336248547"},"directories":{},"publish_time":1498726137168,"_hasShrinkwrap":false,"_cnpm_publish_time":1498726137168,"_cnpmcore_publish_time":"2021-12-17T00:24:28.660Z"},"1.1.2":{"name":"level-logs","version":"1.1.2","description":"Store multiple append only logs in leveldb.","main":"index.js","dependencies":{"lexicographic-integer":"^1.1.0","pump":"^1.0.0","through2":"^0.6.3","from2":"^1.3.0","stream-collector":"^1.0.1"},"devDependencies":{"memdb":"^0.2.0","standard":"^2.3.1","tape":"^3.5.0"},"scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"https://github.com/mafintosh/level-logs.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/level-logs/issues"},"homepage":"https://github.com/mafintosh/level-logs","gitHead":"1c033130383a2b8d4b5a4a34e338a817c8e32aec","_id":"level-logs@1.1.2","_shasum":"70398ca0e0e40e3ae51ce8232f982b76ff6fee99","_from":".","_npmVersion":"2.15.9","_nodeVersion":"4.6.1","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"70398ca0e0e40e3ae51ce8232f982b76ff6fee99","size":3204,"noattachment":false,"key":"/level-logs/-/level-logs-1.1.2.tgz","tarball":"http://name.csiicloud.com:7001/level-logs/download/level-logs-1.1.2.tgz"},"maintainers":[{"name":"mafintosh","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/level-logs-1.1.2.tgz_1477215943717_0.2703720568679273"},"directories":{},"publish_time":1477215945492,"_hasShrinkwrap":false,"_cnpm_publish_time":1477215945492,"_cnpmcore_publish_time":"2021-12-17T00:24:28.929Z"},"1.1.1":{"name":"level-logs","version":"1.1.1","description":"Store multiple append only logs in leveldb.","main":"index.js","dependencies":{"lexicographic-integer":"^1.1.0","pump":"^1.0.0","through2":"^0.6.3","from2":"^1.3.0","stream-collector":"^1.0.1"},"devDependencies":{"memdb":"^0.2.0","standard":"^2.3.1","tape":"^3.5.0"},"scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"https://github.com/mafintosh/level-logs.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/level-logs/issues"},"homepage":"https://github.com/mafintosh/level-logs","gitHead":"0f2fb24b02149b05427494367346ed10766c264e","_id":"level-logs@1.1.1","_shasum":"ff82a2b24b8d724f1a2b111e51b8d4732800bde5","_from":".","_npmVersion":"2.15.9","_nodeVersion":"4.6.1","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"ff82a2b24b8d724f1a2b111e51b8d4732800bde5","size":3207,"noattachment":false,"key":"/level-logs/-/level-logs-1.1.1.tgz","tarball":"http://name.csiicloud.com:7001/level-logs/download/level-logs-1.1.1.tgz"},"maintainers":[{"name":"mafintosh","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/level-logs-1.1.1.tgz_1477215433162_0.7096522348001599"},"directories":{},"publish_time":1477215435044,"_hasShrinkwrap":false,"_cnpm_publish_time":1477215435044,"_cnpmcore_publish_time":"2021-12-17T00:24:29.182Z"},"1.1.0":{"name":"level-logs","version":"1.1.0","description":"Store multiple append only logs in leveldb.","main":"index.js","dependencies":{"lexicographic-integer":"^1.1.0","pump":"^1.0.0","through2":"^0.6.3","from2":"^1.3.0","stream-collector":"^1.0.1"},"devDependencies":{"memdb":"^0.2.0","standard":"^2.3.1","tape":"^3.5.0"},"scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"https://github.com/mafintosh/level-logs.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/level-logs/issues"},"homepage":"https://github.com/mafintosh/level-logs","gitHead":"37a65be031c1a085423f40cb7f32e3b4cbf55328","_id":"level-logs@1.1.0","_shasum":"15f75c9144fbb941ca251df4696d7ad467b78ad2","_from":".","_npmVersion":"2.5.1","_nodeVersion":"1.3.0","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"maintainers":[{"name":"mafintosh","email":""}],"dist":{"shasum":"15f75c9144fbb941ca251df4696d7ad467b78ad2","size":3203,"noattachment":false,"key":"/level-logs/-/level-logs-1.1.0.tgz","tarball":"http://name.csiicloud.com:7001/level-logs/download/level-logs-1.1.0.tgz"},"directories":{},"publish_time":1425485082167,"_hasShrinkwrap":false,"_cnpm_publish_time":1425485082167,"_cnpmcore_publish_time":"2021-12-17T00:24:29.375Z"},"1.0.0":{"name":"level-logs","version":"1.0.0","description":"Store multiple append only logs in leveldb.","main":"index.js","dependencies":{"lexicographic-integer":"^1.1.0","pump":"^1.0.0","through2":"^0.6.3","from2":"^1.3.0","stream-collector":"^1.0.1"},"devDependencies":{"memdb":"^0.2.0","standard":"^2.3.1","tape":"^3.5.0"},"scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"https://github.com/mafintosh/level-logs.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/level-logs/issues"},"homepage":"https://github.com/mafintosh/level-logs","gitHead":"2c9e203f3fb2f17fc0c82b1492ecc05b6c4a83d1","_id":"level-logs@1.0.0","_shasum":"f3119cf23f028df279769c268657277d2ee978db","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"maintainers":[{"name":"mafintosh","email":""}],"dist":{"shasum":"f3119cf23f028df279769c268657277d2ee978db","size":3196,"noattachment":false,"key":"/level-logs/-/level-logs-1.0.0.tgz","tarball":"http://name.csiicloud.com:7001/level-logs/download/level-logs-1.0.0.tgz"},"directories":{},"publish_time":1422730316712,"_hasShrinkwrap":false,"_cnpm_publish_time":1422730316712,"_cnpmcore_publish_time":"2021-12-17T00:24:29.571Z"}},"readme":"# level-logs\n\nStore multiple append only logs in leveldb.\n\n```\nnpm install level-logs\n```\n\n[![build status](http://img.shields.io/travis/mafintosh/level-logs.svg?style=flat)](http://travis-ci.org/mafintosh/level-logs)\n\n## Usage\n\n``` js\nvar logs = require('level-logs')(db) // where db is a levelup\n\nlogs.append('mathias', 'hello', function (err) {\n  logs.append('mathias', 'world', function (err) {\n    logs.createReadStream('mathias')\n      .on('data', function (data) {\n        console.log(data)\n      })\n  })\n})\n```\n\nRunning the above outputs\n\n``` js\n{\n  log: 'mathias',\n  seq: 1,\n  value: 'hello'\n}\n{\n  log: 'mathias',\n  seq: 2,\n  value: 'world'\n}\n```\n\n## API\n\n#### `logs = levelLogs(db, [options])`\n\nCreate a new logs instance. Options include\n\n```\n{\n  valueEncoding: 'json', // set a levelup value encoding\n  prefix: 'logs',        // prefix all keys with this prefix\n  separator: '!'         // use this as log key separator\n}\n```\n\n#### `logs.append(log, value, cb)`\n\nAppend a value to a log.\n\n#### `logs.put(log, seq, value, [cb])`\n\nInsert a value into a log at position `seq`. Normally you want seq to be the head of the log +1.\nThis method is useful if you want to cache the head position of the log somehow.\n\n``` js\nlogs.head('mathias', function (err, seq) {\n  logs.put('mathias', seq + 1, 'hello', function (err) {\n    ...\n  })\n})\n```\n\n#### `logs.get(log, seq, cb)`\n\nGet a value from a log at position `seq`\n\n#### `logs.head(seq, cb)`\n\nThe the head `seq` of a log. If the log doesn't exist the head will be `0`\n\n``` js\nlogs.head('some-log', function (err, seq) {\n  console.log('head of some-log is', seq)\n})\n```\n\n#### `stream = logs.list()`\n\nReturn a list of all logs names as a readable stream\n\n``` js\nvar names = logs.list()\n\nnames.on('data', function (name) {\n  console.log('there is a log called', name)\n})\n```\n\n#### `key = logs.key(log, seq)`\n\nGet the leveldb key the value stored in a log at position `seq`.\nThis is useful if you want to batch multiple operations together.\n\n## License\n\nMIT\n","_attachments":{},"homepage":"https://github.com/mafintosh/level-logs","bugs":{"url":"https://github.com/mafintosh/level-logs/issues"},"license":"MIT"}