{"name":"n-readlines","version":"0.2.7","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":"7287e8c02e865f01c35aa451948d47419719552f","bugs":{"url":"https://github.com/nacholibre/node-readlines/issues"},"homepage":"https://github.com/nacholibre/node-readlines#readme","_id":"n-readlines@0.2.7","_shasum":"940630a1014949822470e490ae635b54f202b6bc","_from":".","_npmVersion":"3.7.3","_nodeVersion":"5.9.0","_npmUser":{"name":"nacholibre","email":"jonidev@gmail.com"},"dist":{"shasum":"940630a1014949822470e490ae635b54f202b6bc","tarball":"http://registry-npm.ywwl.com/n-readlines/download/n-readlines-0.2.7.tgz","integrity":"sha512-PcCzRlUo9pCDyCp2DrESayYXwV3/UdEykOhe1o3ga2SU3wfTE43YH4XJdUseW+oZDUtphwdH+Z8LKzrtYCUq1Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEcQ7KofEmWBPMNzIbkkzEl0MQVL934O9pzAJsKi3HCOAiAHhfDe08FwKuvgum4Q03rXE7PgWk8uH4p0KhuKBUV85w=="}],"size":16920,"noattachment":false,"key":"/n-readlines/-/n-readlines-0.2.7.tgz"},"maintainers":[{"name":"nacholibre","email":"jonidev@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/n-readlines-0.2.7.tgz_1472805549950_0.7122631568927318"},"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":1472805551935,"_cnpm_publish_time":1472805551935,"dist-tags":{"latest":"3.4.1"}}