{"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","test-travis":"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.0","gitHead":"d0e3ef802c6713e9c4676ae16941c1c174453a06","_id":"firstline@2.0.0","_npmVersion":"5.6.0","_nodeVersion":"10.1.0","_npmUser":{"name":"pensierinmusica","email":"alessandro@zanardi.org"},"dist":{"integrity":"sha512-+HaXByTp6XYCIu4ejJRJZ7aqV7pp/kAjknw4MIOacDfGwek/OIkwtFg2nE12aCgiySY/RFjsPIz3hqu6KFeFSg==","shasum":"c9a99d810204649cc1ee1477c07ce033be01945e","tarball":"http://registry-npm.ywwl.com/firstline/download/firstline-2.0.0.tgz","fileCount":9,"unpackedSize":299933,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbA5MqCRA9TVsSAnZWagAAIQkQAKNBBxa7F6g3ooP6S46D\n8B6gNasWh7X3oYDuB0yVJIWdhVNfFYcWksMyauV6LaxO9mOz3LSujqiO+DJ6\n/D8fpzLWmsdlGjCkgqwM6Nq1M4/n7hiyXHGJVULocJ6m61Zf0ct2fqr+6L+r\nW6xzNdxhdljqVheVIfDQHtS7pJBLIbP26kdJRlTKv/mOOdrIWy1xiPQN4zLC\nvaYjouZ9Xyb6nvQ2sNAVFgJVegJiWW4+M2J3H3IDbN7eEOYhMXJcs+DE1SnU\n5nQV52YndS70Uf81Ewxu08XVKDq+a4PufeoxOlDtfdyEhsHo+a1SxtsMI52W\n2uaUCsyn+bMcLnuiVjSGHk80FqT/ERdvUmEdiB2LGWr3d1KEClM1GILLd16H\njDQmcOvq+gWKhCe/qtRNV/PLRQxt7yRHE10kzodc7gMvuJtSdIyaCoDWGLQ4\nI5GFqFti0Hxd+9/2Rjvc7fupKq6do30YH8N+JWiJkQaYTkn/62FGENzfgy1+\n7gfmYGPJnOSboG0YxZicU34UJkq7evmdgGsGgfd2IsocTBY+AO8cyfRzbRVy\nWGdsH3LkNOKXKL9ON2afp64FlhoHlfiYRWVHARNnmE7xmytOsgJXYOauCCcR\nHqsiXy7s0gYJjgSMCqyvw1TSBM/0luVDDNAqOTNiVTJd30sL10nnExxrDffQ\nZ9iO\r\n=9rzh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDha8AcSfa8ZAgW+y7R+F5aRSi6Bbv3a9zho8SCJi/0gAIhAPkmeY5hiXhdt6PdpVLUKgPBiPTAc17kRjj3fgvz/rAU"}],"size":5989,"noattachment":false,"key":"/firstline/-/firstline-2.0.0.tgz"},"maintainers":[{"name":"pensierinmusica","email":"alessandro@zanardi.org"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firstline_2.0.0_1526960937995_0.34643083531116403"},"_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":1526960938096,"_cnpm_publish_time":1526960938096,"dist-tags":{"latest":"2.0.2"}}