{"name":"readline","version":"0.0.3","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","_id":"readline@0.0.3","dist":{"shasum":"5ab3a494460fd9239cfdeb948e948d63ec51bc7a","tarball":"http://registry-npm.ywwl.com/readline/download/readline-0.0.3.tgz","integrity":"sha512-1bf9vKCosSjQ8JichUEm0LtU5GN+kD3O9DA8RqG8IrNFaoZyk4hszt8jm0CCIFn0CL5r5jKp7wpEI5/1AJv9Ow==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC0J76vvEv0QXfIglDOQQlAgu5QE48Hmavw2gaSAxC3MwIhAIK/WkTcsHZEWG9TfB080d8APisu9EFUotuEciglJpZ2"}],"size":734695,"noattachment":false,"key":"/readline/-/readline-0.0.3.tgz"},"_from":".","_npmVersion":"1.2.18","_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":1373497427150,"_cnpm_publish_time":1373497427150,"dist-tags":{"latest":"1.3.0"}}