{"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 . --ext js,json --ignore-pattern !.*","pre-commit":"npm test","semantic-release":"semantic-release","travis-deploy-once":"travis-deploy-once","test":"npm run lint && 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","eslint-plugin-json":"^1.2.0","husky":"^0.14.3","istanbul":"^0.4.5","js-promisify":"^1.1.0","mocha":"^5.1.1","nyc":"^11.7.1","rimraf":"^2.6.2","semantic-release":"^15.1.7","travis-deploy-once":"^4.4.1"},"version":"1.3.0","gitHead":"5e86a742fd6139d863fb145b8d639680514c00a1","_id":"firstline@1.3.0","_npmVersion":"5.6.0","_nodeVersion":"10.0.0","_npmUser":{"name":"pensierinmusica","email":"alessandro@zanardi.org"},"dist":{"integrity":"sha512-GtCMhv3DdudfGPCDWSQF6p2FixCyaFukZiU4UyT0cp07h2l9sIA8+goI4P2CZsImUXkEMT1TmXzmt3wYlXgp2g==","shasum":"aa7b4e9fb9874ac49ecc3f42acc90e08863cbb4b","tarball":"http://registry-npm.ywwl.com/firstline/download/firstline-1.3.0.tgz","fileCount":11,"unpackedSize":303251,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa4hmTCRA9TVsSAnZWagAAaHkP/1rhw5V0LBXRnfZA0cZY\nf0FOIxRNaOqBtTPIrTFpuUqQzXQV52FOrxe/2GS2sORcCkcje3Yc3lwoTq71\nN7RInoMU6QDuVVA6LthoadFF4143E/8soWEdiSjxEkYefAtdVwUKXoe31MUc\nYwnpPFvXc4dVS7vUFagMx4UTpw5dnK1KARCExQm0q9kkOJ/D4pEiNPE/fcW0\nNh7UC4yLB6ZYM2r14/qfFDkLT5jnj+I30KJjE5E62+b6jJyqVzs6wRr52Jb6\n3rwftcb9xO9w7PW4nUEu4vvsNwHsCXdrCTUxzBY/nr7UCAL9GGAqOv4+f47R\nmNMTQwpIZj5c8OOlszR0adsHn9pfUhNijXp5k/XiWkQWOEqLFhnHKJR8zJnH\n54krROteWKvj5U7pPeqqFDH4AT8vlfwbu5PGKBmGX6IpN/Vfnyo4nVjTw9qK\nUZ7uCX3+TU9LniaUylYumYoG40xh/uPxOx7XHiSaXsI1gAZ4c+KOLrg1Sr2p\nBiDztXlZwjo9EW+e2IkFgrui6VhobUEA+agiGafcw32BH4UeeGeB1BFCgmdO\nIpw2+bEUZ9m44W7XQ8S17MXNG63EsrdqV2n8Lqlfmf/sUrRyk/d1pGfr9iFw\noZIaXyx9t3G3XT1ZxNOP79ZJb9TBWpo1bdSaMnd/KuwUbZ3RNh5+YnpXRkPL\n/pqY\r\n=zDGl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBpJOjuPKS/jE6HTBUdJe+BdblxKcGzhM7Ms8p8zuVtxAiEA8cDMn6I8tLG56/uUUxWYW64xKea6rj1UGTXYEqgSjOw="}],"size":6851,"noattachment":false,"key":"/firstline/-/firstline-1.3.0.tgz"},"maintainers":[{"name":"pensierinmusica","email":"alessandro@zanardi.org"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firstline_1.3.0_1524767122476_0.45353024923983964"},"_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":1524767122840,"_cnpm_publish_time":1524767122840,"dist-tags":{"latest":"2.0.2"}}