{"name":"readline","version":"0.0.4","description":"simple streaming readline module","main":"readline.js","scripts":{"test":"tap --tap  --stderr --timeout=120 test/*.js"},"dependencies":{},"devDependencies":{"tap":"0.4.3"},"repository":{"type":"git","url":"git@github.com:maleck13/readline.git"},"keywords":["readline","file"],"author":{"name":"craig brookes"},"license":"BSD","bugs":{"url":"https://github.com/maleck13/readline/issues"},"homepage":"https://github.com/maleck13/readline","_id":"readline@0.0.4","dist":{"shasum":"45617d26ee609613f8340acffe415d579f26373c","tarball":"http://registry-npm.ywwl.com/readline/download/readline-0.0.4.tgz","integrity":"sha512-2Im1bedQ7eGYFFjFX/W5FEBsccEfRsq0hLR4xwtm9TBZWY5UBBQAYQnTSo224ADaYJKQwOBgIHWuucBzUbNiTQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEoSFi+R2Yzbg5wuk+Bb3w5XxzH3pwo6EzrM98Lu+GvLAiA2xxgToEVrnBzZm8PvpgJBflk6K2/EQPsALzhpkZYYow=="}],"size":737581,"noattachment":false,"key":"/readline/-/readline-0.0.4.tgz"},"_from":".","_npmVersion":"1.3.21","_npmUser":{"name":"craigbrookes","email":"craigbrookes@gmail.com"},"maintainers":[{"name":"craigbrookes","email":"craigbrookes@gmail.com"}],"directories":{},"readme":"## _readline_\n> Read a file line by line.\n\n## Install\n\n## Important. In node 10 there is a core module named readline. Please use linebyline instead, it is the same module just renamed:\n[Npm linebyline](https://www.npmjs.com/package/linebyline)\n\n```sh\nnpm install linebyline\n```\n\n## Test\n```sh\nnpm install .\nnpm test\n\n```\n\n\n## What's this?\n\nSimple streaming readline module for NodeJS. Reads a file and buffers new lines emitting a _line_ event for each line.\n\n## Usage\n### Simple\n```js\n  var readline = require('linebyline'),\n      rl = readline('./somefile.txt');\n  rl.on('line', function(line, lineCount, byteCount) {\n    // do something with the line of text\n  })\n  .on('error', function(e) {\n    // something went wrong\n  });\n```\n\n### ASCII file decoding\nAs the underlying `fs.createReadStream` doesn't care about the specific ASCII encoding of the file, an alternative way to decode the file is by telling the `readline` library to retain buffer and then decoding it using a converter (e.g. [`iconv-lite`](https://www.npmjs.com/package/iconv-lite)).\n```js\n  var readline = require('linebyline'),\n      rl = readline('./file-in-win1251.txt', {\n    retainBuffer: true //tell readline to retain buffer \n  });\n  rl.on(\"line\", function (data,linecount){\n    var line = iconv.decode(data, 'win1251');\n    // do something with the line of converted text\n  });\n```\n##API\n## readLine(readingObject[, options])\n### Params:\n\n* `readingObject` - file path or stream object\n* `options` can include:\n  * `maxLineLength` - override the default 4K buffer size (lines longer than this will not be read)\n  * `retainBuffer` - avoid converting to String prior to emitting 'line' event; will pass raw buffer with encoded data to the callback\n\n### Return:\n\n* **EventEmitter** \n\n\n## License\n\nBSD © [Craig Brookes](http://craigbrookes.com/)\n","publish_time":1412457573048,"_cnpm_publish_time":1412457573048,"dist-tags":{"latest":"1.3.0"}}