{"name":"n-readlines","version":"0.2.4","description":"Read file line by line without buffering the whole file in memory.","main":"./readlines.js","dependencies":{},"repository":{"type":"git","url":"git+ssh://git@github.com/nacholibre/node-readlines.git"},"keywords":["read","line","reader","linereader","readfile","linebyline","synchronous","sync","readline","readlines"],"engines":{"node":">=0.10.0"},"devDependencies":{"mocha":"^2.0.1"},"scripts":{"test":"./node_modules/mocha/bin/mocha *_test.js"},"author":{"name":"Yoan Arnaudov","email":"jonidev@gmail.com"},"license":"MIT","gitHead":"2146c39293b1377b29f1f3910fbd0dac7f706772","bugs":{"url":"https://github.com/nacholibre/node-readlines/issues"},"homepage":"https://github.com/nacholibre/node-readlines#readme","_id":"n-readlines@0.2.4","_shasum":"a4715972c4f7623ed23c41daf7ba4090637213e3","_from":".","_npmVersion":"3.6.0","_nodeVersion":"5.7.0","_npmUser":{"name":"nacholibre","email":"jonidev@gmail.com"},"dist":{"shasum":"a4715972c4f7623ed23c41daf7ba4090637213e3","tarball":"http://registry-npm.ywwl.com/n-readlines/download/n-readlines-0.2.4.tgz","integrity":"sha512-feOygooG4RdSsN9rQtjPva0OuMWRfUKLA8GiUwYHAErtUKPJJPt7Pq+X77qtrwEqZsb8x0WvVfMk3FvZG6beNg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICj7BCKRp8WCLFwilGxt4CCFE0UMNLcr9cRR3hWllKPgAiEArHlfrW5kaKBLJIn0b2XtvvNFFgOc7MsyspeGf84E47I="}],"size":3284,"noattachment":false,"key":"/n-readlines/-/n-readlines-0.2.4.tgz"},"maintainers":[{"name":"nacholibre","email":"jonidev@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/n-readlines-0.2.4.tgz_1465232143152_0.2521090966183692"},"directories":{},"readme":"[![Build Status](https://travis-ci.org/nacholibre/node-readlines.svg)](https://travis-ci.org/nacholibre/node-readlines)\n# node-readlines\nReading file line by line may seem like a trivial problem, but in node, there is no straightforward way to do it. There are a lot of libraries using Transform Streams to achieve it, but it seems like a overkill, so I've wrote simple version using only the `filesystem` module of node. Note that this is *synchronous* library.\n\nInstall with\n`npm install n-readlines`\n\n---------------------------------------\n\n## Documentation\n### new readlines(filename, [options]);\n### new readlines(fd, [options]);\n\n**Arguments**\n\n* `filename` - String path to the file you want to read from\n* `fd` - File descriptor\n* `options` - Object\n  * `readChunk` - Integer number of bytes to read at once. Default: 1024\n  * `newLineCharacter` - String new line character, only works with one byte characters for now. Default: `\\n` which is `0x0a` hex encoded\n\n`node-readlines` can handle files without newLineCharacter after the last line\n\n---------------------------------------\n\n### readlines.next()\nReturns `buffer` with the line data without the `newLineCharacter` or `false` if end of file is reached.\n\n---------------------------------------\n### readlines.reset()\nResets the pointer and starts from the beginning of the file. This works only if the end is not reached.\n\n---------------------------------------\n### readlines.close()\nManually close the open file, subsequent `next()` calls will return false. This works only if the end is not reached.\n\n---------------------------------------\n\n## Example\n```javascript\nconst lineByLine = require('n-readlines');\nconst liner = new lineByLine('./test/fixtures/normalFile.txt');\n\nlet line;\nlet lineNumber = 0;\n\nwhile (line = liner.next()) {\n    console.log('Line ' + lineNumber + ': ' + line.toString('ascii'));\n    lineNumber++;\n}\n\nconsole.log('end of line reached');\n```\n","publish_time":1465232145763,"_cnpm_publish_time":1465232145763,"dist-tags":{"latest":"3.4.1"}}