{"name":"firstline","version":"1.2.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","devDependencies":{"chai":"^3.5.0","chai-as-promised":"^5.2.0","coveralls":"^2.11.8","istanbul":"^0.4.2","js-promisify":"^1.0.4","mocha":"^2.4.5","rimraf":"^2.5.2","semantic-release":"^4.3.5"},"engines":{"node":">=4.0.0"},"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"},"gitHead":"9d35e85bdbaad1111428cdd53f904fc04e158a83","_id":"firstline@1.2.0","_shasum":"c9f4886e7f7fbf0afc12d71941dce06b192aea05","_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":"c9f4886e7f7fbf0afc12d71941dce06b192aea05","tarball":"http://registry-npm.ywwl.com/firstline/download/firstline-1.2.0.tgz","integrity":"sha512-JBzSqQYZvZaD3aHRG1okOog1aZXuXCWHcf9BzkpHYIN9s9zQQCjFajawWxGzDco50p9wtg93A5qC90gnnfngKg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDOdKBDVfNAzzuPdyEtQV6hCdCqDKzZs2YndWcoPjGJ3AiAlgK8eF5Mv3ACF98CnpUBwhTKHx2vrYw+ZSjaADToNSw=="}],"size":5523,"noattachment":false,"key":"/firstline/-/firstline-1.2.0.tgz"},"_npmOperationalInternal":{"host":"packages-13-west.internal.npmjs.com","tmp":"tmp/firstline-1.2.0.tgz_1457524918788_0.917569937184453"},"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":1457524923302,"_cnpm_publish_time":1457524923302,"dist-tags":{"latest":"2.0.2"}}