{"name":"firstline","version":"1.1.2","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","devDependencies":{"chai":"^3.5.0","chai-as-promised":"^5.2.0","coveralls":"^2.11.8","istanbul":"^0.4.2","js-promisify":"^1.0.3","mocha":"^2.4.5","rimraf":"^2.5.2"},"engines":{"node":">=4.0.0"},"scripts":{"test":"mocha","test-travis":"./node_modules/istanbul/lib/cli.js cover ./node_modules/mocha/bin/_mocha"},"gitHead":"38a12cb612cfb2b623584328d079a9ba3a0259d1","_id":"firstline@1.1.2","_shasum":"f6f9ad418bd8a1d2643cd92ed1983cbf35337b4f","_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":"f6f9ad418bd8a1d2643cd92ed1983cbf35337b4f","tarball":"http://registry-npm.ywwl.com/firstline/download/firstline-1.1.2.tgz","integrity":"sha512-NWyok3LNJuRPHYp55wqqj+kxvdDgn6HY78ok3Xphueqh/qcAIfNkbg7gmnqLVLhQRNHB3BcVcC59ElsNCZMDig==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCaJEg9jLbPXgtbR5UryOWBis6MVn/nn5nVIaAlhIlhpwIhAPUwer1n6igHQUFVoawWRq12/hUZHMH7ynEdJbCqI4Cg"}],"size":5305,"noattachment":false,"key":"/firstline/-/firstline-1.1.2.tgz"},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/firstline-1.1.2.tgz_1457289788442_0.7413943896535784"},"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":1457289791515,"_cnpm_publish_time":1457289791515,"dist-tags":{"latest":"2.0.2"}}