{"name":"firstline","description":"Async npm module for Node JS that reads the first line of a file","main":"index.js","scripts":{"test":"mocha","test-travis":"./node_modules/istanbul/lib/cli.js cover ./node_modules/mocha/bin/_mocha","semantic-release":"semantic-release pre && npm publish && semantic-release post"},"repository":{"type":"git","url":"git+https://github.com/pensierinmusica/firstline.git"},"homepage":"https://github.com/pensierinmusica/firstline","bugs":{"url":"https://github.com/pensierinmusica/firstline/issues"},"keywords":["read","check","file","content","filesystem","io","stream","async","promise"],"author":{"name":"Alessandro Zanardi"},"license":"MIT","engines":{"node":">=4.0.0"},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"},"ghooks":{"pre-commit":"mocha"}},"devDependencies":{"chai":"^3.5.0","chai-as-promised":"^5.2.0","coveralls":"^2.11.8","cz-conventional-changelog":"^1.1.7","ghooks":"^1.0.3","istanbul":"^0.4.2","js-promisify":"^1.1.0","mocha":"^2.4.5","rimraf":"^2.5.2","semantic-release":"^4.3.5"},"version":"1.2.1","gitHead":"b056f852689619e29de5f6235f877718154c70a3","_id":"firstline@1.2.1","_shasum":"b88673c42009f8821fac2926e99720acee924fae","_from":".","_npmVersion":"2.15.11","_nodeVersion":"7.2.1","_npmUser":{"name":"pensierinmusica","email":"alessandro@zanardi.org"},"dist":{"shasum":"b88673c42009f8821fac2926e99720acee924fae","tarball":"http://registry-npm.ywwl.com/firstline/download/firstline-1.2.1.tgz","integrity":"sha512-6eMQNJtDzyXSC1yeCBWspqA6LeV5la2XHGTXQq4O0xkglAutpyny/sB+zVdXTZ9nzcDW9ZGLxwXXkB+ZEtJuPw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFM/QA3kFwOf60B7aA0TaRWtc8YgSMp+negvOPw3+LM7AiAQem8MVdBX+9sFzN8p9zzJV7TFSGWrT+EfS3O58W4H+A=="}],"size":5566,"noattachment":false,"key":"/firstline/-/firstline-1.2.1.tgz"},"maintainers":[{"name":"pensierinmusica","email":"alessandro@zanardi.org"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/firstline-1.2.1.tgz_1481145382977_0.6442857182119042"},"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":1481145383518,"_cnpm_publish_time":1481145383518,"dist-tags":{"latest":"2.0.2"}}