{"name":"n-readlines","version":"0.2.3","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":"f7866d9c42d6a391025135abff13574d8b2e9bad","bugs":{"url":"https://github.com/nacholibre/node-readlines/issues"},"homepage":"https://github.com/nacholibre/node-readlines#readme","_id":"n-readlines@0.2.3","_shasum":"ec25ab1b6f09c45cdf8c4037ab83b1ad75483316","_from":".","_npmVersion":"3.7.3","_nodeVersion":"5.9.0","_npmUser":{"name":"nacholibre","email":"jonidev@gmail.com"},"dist":{"shasum":"ec25ab1b6f09c45cdf8c4037ab83b1ad75483316","tarball":"http://registry-npm.ywwl.com/n-readlines/download/n-readlines-0.2.3.tgz","integrity":"sha512-v1KWTXcd23RuUTyohKUOsIJLnaGS3vw9bSCK0DjuacpHYZOLT1KmTwBlJL4m57q0e8vh2fyrA5T9tWpsNBNEwg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAohNvIHcLaVHfSExs6vnJ7fUbXIvziSTqiBviIpYlbxAiB5l53yn97kRkxOA3cnJFiZCBUCUPnbz0roOLFJz/AE7Q=="}],"size":3208,"noattachment":false,"key":"/n-readlines/-/n-readlines-0.2.3.tgz"},"maintainers":[{"name":"nacholibre","email":"jonidev@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/n-readlines-0.2.3.tgz_1465205241431_0.456495248246938"},"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":1465205243075,"_cnpm_publish_time":1465205243075,"dist-tags":{"latest":"3.4.1"}}