{"_id":"last-line-stream","_rev":"299579","name":"last-line-stream","description":"A PassThrough stream that keeps track of last line written","dist-tags":{"latest":"1.0.0"},"maintainers":[{"name":"jamestalmage","email":"james@talmage.io"}],"time":{"modified":"2021-06-03T19:03:22.000Z","created":"2016-01-11T02:29:25.219Z","1.0.0":"2016-01-12T22:07:29.305Z","0.1.0":"2016-01-11T02:29:25.219Z"},"users":{},"author":{"name":"James Talmage","email":"james@talmage.io","url":"github.com/jamestalmage"},"repository":{"type":"git","url":"git+https://github.com/jamestalmage/last-line-stream.git"},"versions":{"1.0.0":{"name":"last-line-stream","version":"1.0.0","description":"A PassThrough stream that keeps track of last line written","license":"MIT","repository":{"type":"git","url":"git+https://github.com/jamestalmage/last-line-stream.git"},"author":{"name":"James Talmage","email":"james@talmage.io","url":"github.com/jamestalmage"},"engines":{"node":">=0.10.0"},"scripts":{"test":"xo && nyc --reporter=lcov --reporter=text --cache ava"},"files":["index.js","tracker.js"],"keywords":["stream","streams","line","lines","newline","spy","last","passthrough","pass-through","pass","through"],"dependencies":{"through2":"^2.0.0"},"devDependencies":{"ava":"^0.9.1","coveralls":"^2.11.6","nyc":"^5.3.0","xo":"^0.12.1"},"gitHead":"5be872f541028fb79dbabd28bfa5777a01514854","bugs":{"url":"https://github.com/jamestalmage/last-line-stream/issues"},"homepage":"https://github.com/jamestalmage/last-line-stream#readme","_id":"last-line-stream@1.0.0","_shasum":"d1b64d69f86ff24af2d04883a2ceee14520a5600","_from":".","_npmVersion":"3.5.3","_nodeVersion":"5.3.0","_npmUser":{"name":"jamestalmage","email":"james@talmage.io"},"dist":{"shasum":"d1b64d69f86ff24af2d04883a2ceee14520a5600","size":2223,"noattachment":false,"key":"/last-line-stream/-/last-line-stream-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/last-line-stream/download/last-line-stream-1.0.0.tgz"},"maintainers":[{"name":"jamestalmage","email":"james@talmage.io"}],"directories":{},"publish_time":1452636449305,"_cnpm_publish_time":1452636449305,"_hasShrinkwrap":false},"0.1.0":{"name":"last-line-stream","version":"0.1.0","description":"A PassThrough stream that keeps track of last line written","license":"MIT","repository":{"type":"git","url":"git+https://github.com/jamestalmage/last-line-stream.git"},"author":{"name":"James Talmage","email":"james@talmage.io","url":"github.com/jamestalmage"},"engines":{"node":">=0.10.0"},"scripts":{"test":"xo && nyc --reporter=lcov --reporter=text --cache ava"},"files":["index.js"],"keywords":["stream","streams","line","lines","newline","spy","last","passthrough","pass-through","pass","through"],"dependencies":{"through2":"^2.0.0"},"devDependencies":{"ava":"^0.9.1","coveralls":"^2.11.6","nyc":"^5.3.0","xo":"^0.12.1"},"gitHead":"6dfdfff90de04bd081c7e7763a8eaa693b3dd1e3","bugs":{"url":"https://github.com/jamestalmage/last-line-stream/issues"},"homepage":"https://github.com/jamestalmage/last-line-stream#readme","_id":"last-line-stream@0.1.0","_shasum":"40d7ec63085734819216771a9daa11e34563e6df","_from":".","_npmVersion":"3.5.3","_nodeVersion":"5.3.0","_npmUser":{"name":"jamestalmage","email":"james@talmage.io"},"dist":{"shasum":"40d7ec63085734819216771a9daa11e34563e6df","size":1988,"noattachment":false,"key":"/last-line-stream/-/last-line-stream-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/last-line-stream/download/last-line-stream-0.1.0.tgz"},"maintainers":[{"name":"jamestalmage","email":"james@talmage.io"}],"directories":{},"publish_time":1452479365219,"_cnpm_publish_time":1452479365219,"_hasShrinkwrap":false}},"readme":"# last-line-stream \n\n> A PassThrough stream that keeps track of last line written.\n\n[![Build Status](https://travis-ci.org/jamestalmage/last-line-stream.svg?branch=master)](https://travis-ci.org/jamestalmage/last-line-stream) [![Coverage Status](https://coveralls.io/repos/jamestalmage/last-line-stream/badge.svg?branch=master&service=github)](https://coveralls.io/github/jamestalmage/last-line-stream?branch=master)\n\n\n## Install\n\n```\n$ npm install --save last-line-stream\n```\n\n\n## Usage\n\n```js\nconst lastLineStream = require('last-line-stream');\n\nconst stream = lastLineStream();\n\nstream.write('foo');\n\nassert(stream.lastLine === 'foo');\n\nstream.write('bar');\n\nassert(stream.lastLine === 'foobar');\n\nstream.write('baz\\nquz');\n\nassert(stream.lastLine === 'quz');\n```\n\n\n## API\n\n### lastLineStream([pipeTo])\n\nReturns a new instance of the spying PassThrough stream, \n\n#### pipeTo\n\nType: `stream`\n\nIf supplied, the new instance will automatically be piped to this stream.\n\n### stream.lastLine\n\nType: `string`\n\nThe last line written out to this stream. The `lastLine` value will grow until the stream sees a newline character (`'\\n'`).\n\n## Low Level API\n\nA low-level non-stream based API is available. It has only two methods.\n\n```js\nvar createTracker = require('last-line-stream/tracker');\nvar tracker = createTracker();\n\n// append some text.\ntracker.update(someString);\n\n// Find the complete last line of all the text appended.\ntracker.lastLine();\n```\n\n## License\n\nMIT © [James Talmage](http://github.com/jamestalmage)\n","_attachments":{},"homepage":"https://github.com/jamestalmage/last-line-stream#readme","bugs":{"url":"https://github.com/jamestalmage/last-line-stream/issues"},"license":"MIT"}