{"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.1","gitHead":"d9231f6e02915e2344d727b473f4ba724b579083","_id":"firstline@2.0.1","_npmVersion":"5.6.0","_nodeVersion":"10.1.0","_npmUser":{"name":"pensierinmusica","email":"alessandro@zanardi.org"},"dist":{"integrity":"sha512-Vqgit04oyP6bXe2WXDZqh2kfohkLD+R+SEWPrpyffMpghjXvFo0snrVQL0Mxxsgs+FRWTK3d/qcN4egyZQRJxg==","shasum":"d05a36f9ddb4fa969887f493cf0deece33c0509f","tarball":"http://registry-npm.ywwl.com/firstline/download/firstline-2.0.1.tgz","fileCount":9,"unpackedSize":300233,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbA6h6CRA9TVsSAnZWagAAL7QP/1ZbrLDTJZRpHIYKs7qb\n/QGxE+W1Cfs6i0WX2D6JYHdpxtshPGG7aHTVLhEtGOae91iQqXm3eIHS+at1\nIdDWeUSqDL5fMTgO6fkdmNgaxsLlfMgO0ezL5A/3/5amlOFAjHd4b0EAb3u6\n+JXhL/XBM7Yagzy4SB36wntntj2Pd92I4RKlJWox/DS1JFshe6DXBmJnf1gV\nutThRqmfHIcSgwolP3hPOJd2QlifYkWouBWjYBy1HFW2FuLcU86UW3SHlXzH\nK1wER82wyAKDmVLTeuYPoX7ScgIpD/zJzAXUKDNPt3kl0LuB8YzkcriorAAz\n92TmRaHKEOCEE59Z7cxXEbSDhQkhHSToIMTvMLEZMgo0M9R5QAQhW1MoAs3g\ntJ16ZEE+sLheFGVxZ9itMy9pTxdgl5zb3N7IBE15Nehezds+3rz3i6WDfVq1\nEjQ2+6ret19M5NpJpJStuHYF46tN5G47g+FaVbEP2AqrmXV2UmYQ5KQRi/R3\nfQQBwG0nz05A11/2C63Ep3a24c9Y9RwDMQ3oobzPVio/HecE+R97g8SBuC32\n3EOU6V3il4NBs+XiaS7XRDHLOZGlkhBIOxkO5azLjPdmwj8bSRlHWkIr9ZXo\n5j4TmvnFfCCRAJgOmFN47N6hHcQ04Ju756SgW5NoesLcT0O9la1aj0LqVYV0\n7OYX\r\n=UBT3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAjNVEDPGN2eLZOxydroek8fKqvdrHNEuKiRvuZG61qsAiEAvcKNwfRfZF2/r7xAoCyxJKEToTlA452Dsxx9noiaVtk="}],"size":6028,"noattachment":false,"key":"/firstline/-/firstline-2.0.1.tgz"},"maintainers":[{"name":"pensierinmusica","email":"alessandro@zanardi.org"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firstline_2.0.1_1526966394038_0.7662695685036887"},"_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":1526966394268,"_cnpm_publish_time":1526966394268,"dist-tags":{"latest":"2.0.2"}}