{"dist":{"shasum":"38b3c42bd4aefd32b8bd9f031999eb7a07bcb0e6","tarball":"https://registry.npmjs.org/line-input-stream/-/line-input-stream-1.0.0.tgz","integrity":"sha512-U/i/5soi5o/QVTvUzh1qPlIwAzPWV3OW0oZseOsNoTOVs8UGgMabMYJu3PcJBsQUsG5Yl7UWROSRnaE2OiKSrw==","signatures":[{"sig":"MEUCIQCBXaQmKjx7r3nCSaRclqWdUU/EkSg71NYWX5ud3NqAlwIgRXpa2zkPbPoJjjOxqTYH2yBmgMs0VzStv6cvJIgEcg0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"lib/line-input-stream.js","name":"line-input-stream","files":["lib/"],"author":{"url":"http://bluesmoon.info/","name":"Philip Tellis","email":"philip@bluesmoon.info"},"readme":"node-line-input-stream\n======================\n\nConvert a Node.JS Readable Stream into a Line Buffered Input Stream\n\nInstall\n---\n\n```\nnpm install line-input-stream\n```\n\nUsage\n---\n\nLike [Readable Stream](http://nodejs.org/api/stream.html#stream_readable_stream) with a `line` event.\n\n```javascript\nvar LineInputStream = require('line-input-stream'),\n    fs = require('fs');\n\nvar stream = LineInputStream(fs.createReadStream(\"foo.txt\", { flags: \"r\" }));\nstream.setEncoding(\"utf8\");\nstream.setDelimiter(\"\\n\");\t// optional string, defaults to \"\\n\"\n\nstream.on(\"error\", function(err) {\n\t\tconsole.log(err);\n\t});\n\nstream.on(\"data\", function(chunk) {\n\t\t// You don't need to use this event\n\t});\n\nstream.on(\"line\", function(line) {\n\t\t// Sends you lines from the stream delimited by delimiter\n\t});\n\nstream.on(\"end\", function() {\n\t\t// No more data, all line events emitted before this event\n\t});\n\nstream.on(\"close\", function() {\n\t\t// Same as ReadableStream's close event\n\t});\n\nif(stream.readable) {\n\tconsole.log(\"stream is readable\");\n}\n\n// Also available: pause(), resume(), destroy(), pipe()\n```\n\nYou can also attach listeners to any event specific to the underlying stream, ie,\nyou can listen to the `open` event for streams created by [`fs.createReadStream()`](http://nodejs.org/api/fs.html#fs_fs_createreadstream_path_options)\nor the `connect` event for [Net](http://nodejs.org/api/net.html) streams.\n\nA side effect of this is that you can add a listener for any junk string and `LineInputStream` will\npretend that it worked.  The event listener may never be called though.\n\nCaveats & Notes\n---\n- Calling `pause()` might not stop `line` events from firing immediately.  It will stop reading of data\n  from the underlying stream, but any data that has already been read will still be split into lines and\n  a `line` event will be fired for each of them.\n- The delimiter is not included in the line passed to the `line` handler\n- Even though this is called `line-input-stream`, you can delimit by anything, so for example,\n  setting delimiter to `\"\\n\\n\"` will read by paragraph (sort of).\n- You can set the delimiter to a regular expression, which let's you do cool things like drop multiple blank lines: `/[\\r\\n]+/`\n\n\nCopyright\n---\nPhilip Tellis [@bluesmoon](https://twitter.com/bluesmoon) <philip@lognormal.com> \n\nLicense\n---\n(Apache License)[LICENSE.md]\n","engines":{"node":">=0.8.8"},"_npmUser":{"name":"bluesmoon","email":"philip@bluesmoon.info"},"homepage":"https://github.com/bluesmoon/node-line-input-stream","keywords":["stream","input","line","line-buffered","readable stream"],"repository":{"url":"git://github.com/bluesmoon/node-line-input-stream.git","type":"git"},"_npmVersion":"1.1.59","description":"Convert a Node.JS Readable Stream into a Line Buffered Input Stream","maintainers":[{"name":"bluesmoon","email":"philip@bluesmoon.info"}],"_id":"line-input-stream@1.0.0","version":"1.0.0"}