{"name":"readline","version":"1.3.0","description":"Simple streaming readline module.","main":"readline.js","scripts":{"test":"tap --tap  --stderr --timeout=120 test/*.js"},"dependencies":{},"devDependencies":{"tap":"0.4.3","iconv-lite":"0.4.13"},"repository":{"type":"git","url":"git@github.com:maleck13/readline.git"},"keywords":["readline","line by line","file"],"author":{"name":"craig brookes"},"license":"BSD","gitHead":"6d3b834e8d55f118436e4b0bda88b0e8cf3084ef","bugs":{"url":"https://github.com/maleck13/readline/issues"},"homepage":"https://github.com/maleck13/readline","_id":"readline@1.3.0","_shasum":"c580d77ef2cfc8752b132498060dc9793a7ac01c","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"craigbrookes","email":"craigbrookes@gmail.com"},"maintainers":[{"name":"craigbrookes","email":"craigbrookes@gmail.com"}],"dist":{"shasum":"c580d77ef2cfc8752b132498060dc9793a7ac01c","tarball":"http://registry-npm.ywwl.com/readline/download/readline-1.3.0.tgz","integrity":"sha512-k2d6ACCkiNYz222Fs/iNze30rRJ1iIicW7JuX/7/cozvih6YCkFZH+J6mAFDVgv0dRBaAyr4jDqC95R2y4IADg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHgKqYULlV+BnJiWidhJ92z0905M8675UdF8+ZUdyMW7AiEAlduxhcsQczOGM8FiKjfEA4vczFOnDTJtje4/c0YYiEw="}],"size":736621,"noattachment":false,"key":"/readline/-/readline-1.3.0.tgz"},"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":1451314647073,"_cnpm_publish_time":1451314647073,"dist-tags":{"latest":"1.3.0"}}