{"name":"firstline","description":"Async npm module for Node JS that reads the first line of a file","main":"index.js","scripts":{"coverage":"nyc report --reporter=text-lcov | coveralls","lint":"eslint .","pre-commit":"npm test","semantic-release":"semantic-release","travis-deploy-once":"travis-deploy-once --pro","test":"npm run lint && nyc mocha"},"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":">=6.4.0"},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"devDependencies":{"chai":"^4.1.2","chai-as-promised":"^7.1.1","coveralls":"^3.0.0","cz-conventional-changelog":"^2.1.0","eslint":"^4.19.1","husky":"^0.14.3","js-promisify":"^1.1.0","mocha":"^5.1.1","nyc":"^11.7.1","rimraf":"^2.6.2","semantic-release":"^15.5.0","travis-deploy-once":"^5.0.0"},"version":"2.0.2","gitHead":"1ddb45976bcc1fe3fb015201f47627cda807e926","_id":"firstline@2.0.2","_npmVersion":"5.6.0","_nodeVersion":"10.2.0","_npmUser":{"name":"pensierinmusica","email":"alessandro@zanardi.org"},"dist":{"integrity":"sha512-8KcmfI0jgSECnzdhucm0i7vrwef3BWwgjimW2YkRC5eSFwjb5DibVoA0YvgkYwwxuJi9c+7M7X3b3lX8o9B6wg==","shasum":"3fdfd894a80e181cd2fa478b07cadb8d446c53cd","tarball":"http://registry-npm.ywwl.com/firstline/download/firstline-2.0.2.tgz","fileCount":9,"unpackedSize":300155,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbBgtSCRA9TVsSAnZWagAAajYP/3rvdGKeLfegZpoYh02v\nCF0Dh4RG94LXWkyKzOUvlzpzeuWDQYd3RzjakoCdlhuOGDDFVbuuknIYcUQI\n4gvAmnfgw6U8NFV0j9YVoVcMtoxOhZFClgnjRpw/Jj6xuOctDI6llBcWdTIQ\nj7SxhjevuNONb7kATHoswCScEz3xVolV/tvQ0YkYUaRVy78x+9doOUP6PWzK\nMk2Ff6yV+CsCms8Iem0Y4Cr8CB+AQCKvuVhmtBPuHNQvUDc/24UCJlbtMnsn\nwEK+AkGAF50owH6xgWW5NE3Ug1DeMJuW+xG3gvxPhOzYUX5//TLH8nVUDvcN\nD6dZ9trVnwFa9zBpE4AyNtvDhTg8eO5qG1vIB2ZgL0/fg4tI27vNwi3mTP0y\nyEkvYuq58gki5YZSFtPnBIbThQzZ4wC41Kgm/XAzOIS2NEq4k4PdgOn9XrDg\nYyzSoSJV+6zvixD9pRVEWBCIMKoLNu8ETno76k7tUKitH679kPTbcvLgdvv5\neo/CBOZXj13bJvpuCZCZ3U/CH8isun0BTNLM2OIP3frtjN1RWEACp9RyOEJI\nkH3MSwyoI50JwfG4dobsn142iHBHQr4wvFAf6saIM3aq+tjBY2WBdwyQXox1\nb2beJYFfSBSOGvYXfDECpZ95XL7nw7Q2ZmctLvtFks/Q+BJAw/VHqZGEvu4H\nD0Pq\r\n=HONf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFAvKWC8bVCbSKzZ0z22B1BXOLx0DECCBfC2HrkDVokIAiEAmbnuXDZTcRCTsP3y9J0LGOS1sKIfntjSS5BoCgAB9yU="}],"size":6013,"noattachment":false,"key":"/firstline/-/firstline-2.0.2.tgz"},"maintainers":[{"name":"pensierinmusica","email":"alessandro@zanardi.org"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firstline_2.0.2_1527122770279_0.8917392099275858"},"_hasShrinkwrap":false,"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":1527122770461,"_cnpm_publish_time":1527122770461,"dist-tags":{"latest":"2.0.2"}}