{"name":"firstline","version":"1.1.0","description":"Async npm module for Node JS that reads the first line of a file","main":"firstline.js","repository":{"type":"git","url":"git+https://github.com/pensierinmusica/firstline.git"},"keywords":["read","check","file","content","filesystem","io","stream","async","promise"],"author":{"name":"Alessandro Zanardi"},"license":"MIT","bugs":{"url":"https://github.com/pensierinmusica/firstline/issues"},"homepage":"https://github.com/pensierinmusica/firstline","dependencies":{},"devDependencies":{"chai":"^2.1.0","chai-as-promised":"^4.2.0","coveralls":"^2.11.2","istanbul":"^0.3.6","js-promisify":"^1.0.2","mocha":"^2.1.0","rimraf":"^2.2.8"},"scripts":{"test":"mocha","test-travis":"./node_modules/istanbul/lib/cli.js cover ./node_modules/mocha/bin/_mocha"},"gitHead":"54c82de4a721a0857f23386ca29c0d39b8bcab4e","_id":"firstline@1.1.0","_shasum":"559c71157fe8485b29c4c1e8cf609a56b2b84718","_from":".","_npmVersion":"3.6.0","_nodeVersion":"5.7.1","_npmUser":{"name":"pensierinmusica","email":"alessandro@zanardi.org"},"maintainers":[{"name":"pensierinmusica","email":"alessandro@zanardi.org"}],"dist":{"shasum":"559c71157fe8485b29c4c1e8cf609a56b2b84718","tarball":"http://registry-npm.ywwl.com/firstline/download/firstline-1.1.0.tgz","integrity":"sha512-/gvjY9unMcKSNGbrPjl4FmXRLTvMP1KYuhdfpTtX0psqAKrFSPqwUDwq6SHv20RBKQjm7xeC9eHPcYnLnFoRcg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGkMkBChoigZHMPLsrI8FPDhkUQSR//fgPKm454EzlguAiEAga8Lbl+nT3p7wc1ZrprGbyQBv6ntjho7zsmF9dqBZck="}],"size":5280,"noattachment":false,"key":"/firstline/-/firstline-1.1.0.tgz"},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/firstline-1.1.0.tgz_1457278733076_0.2613489229697734"},"directories":{},"readme":"# Firstline\n\n[![Build status](https://img.shields.io/travis/pensierinmusica/firstline.svg)](https://travis-ci.com/pensierinmusica/firstline)\n[![Test coverage](https://img.shields.io/coveralls/pensierinmusica/firstline.svg)](https://coveralls.io/r/pensierinmusica/firstline)\n[![Dependencies](https://img.shields.io/david/pensierinmusica/firstline.svg)](https://www.npmjs.com/package/firstline)\n[![Npm version](https://img.shields.io/npm/v/firstline.svg)](https://www.npmjs.com/package/firstline)\n[![License](https://img.shields.io/github/license/pensierinmusica/firstline.svg)](https://www.npmjs.com/package/firstline)\n\n## Introduction\n\nFirstline is a [npm](http://npmjs.org) async module for [NodeJS](http://nodejs.org/), that **reads and returns the first line of any file**. It uses native JS promises and streams (requires Node >= v6.4.0). It is well tested and built for high performance.\n\nIt is particularly suited when you need to programmatically access the first line of a large amount of files, while handling errors if they occur.\n\n## Install\n\n`npm install firstline`\n\n## Usage\n\n`firstline(filePath, [opts])`\n\n- filePath (String): the full path to the file you want to read.\n- opts (Object, optional):\n  - encoding (String), set the file encoding (must be [supported by Node.js](https://nodejs.org/api/buffer.html#buffer_buffers_and_character_encodings)).\n  - lineEnding (String), the character used for line ending (defaults to `\\n`).\n\nIncrementally reads data from `filePath` until it reaches the end of the first line.\n\nReturns a promise, eventually fulfilled with a string.\n\n## Examples\n\n```js\n// Imagine the file content is:\n// abc\n// def\n// ghi\n//\n\nfirstline('./my-file.txt');\n// -> Returns a promise that will be fulfilled with 'abc'.\n\nfirstline('./my-file.txt', { lineEnding: '\\r' });\n// -> Same as above, but using '\\r' as line ending.\n```\n\n***\n\nMIT License","publish_time":1457278736122,"_cnpm_publish_time":1457278736122,"dist-tags":{"latest":"2.0.2"}}