{"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.5.0","travis-deploy-once":"^5.0.0"},"version":"1.3.1","gitHead":"092fb403af3ae119c5d7637976f34597829ef19c","_id":"firstline@1.3.1","_npmVersion":"5.6.0","_nodeVersion":"10.1.0","_npmUser":{"name":"pensierinmusica","email":"alessandro@zanardi.org"},"dist":{"integrity":"sha512-ycwgqtoxujz1dm0kjkBFOPQMESxB9uKc/PlD951dQDIG+tBXRpYZC2UmJb0gDxopQ1ZX6oyRQN3goRczYu7Deg==","shasum":"59e84af0fd858fbc6dac0a0ff97fd22a47e58084","tarball":"http://registry-npm.ywwl.com/firstline/download/firstline-1.3.1.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\nwsFcBAEBCAAQBQJbA2L1CRA9TVsSAnZWagAAkmkQAKGvqTKMGGx9WLhcJzDJ\nMs3dsbnbokHWXmFPNZSRbGJilig0agqcZqJ6pw2zdnzPKfY2J1YgyYLixjdI\nKvY/ePeEzhwImRlwkxk/BJYSNGWsSJmBOahZIqEpYnx0oKFv77lYqUHBmpvH\n1XagC4UvGz9F4WJmLk8jvQ9NS67Jw9jBHQgKijD5mWo5mUBmEv3Up4D+udrx\niLWci6D6laS09kclYgnywCB3KbU/0gPZ/HT1HAi7JiUG0BM9o1uPdpbz8guL\n0QD8ZmZXKhoY07Ce1sWN+hESDRZrNkhlmkioYyQ7ZFJPj/COkflo68atFwFX\n564wvMqExgoQrY9dPFZ7SlKv4hmyrFXAPBMF9DAkSf3ZU5Cq8SlJenmam3oA\nmUQGeuuh6eziBlEmeLu6T3EiQHLkAgLZnR2HjJodL4Vui78A5XNn5DDWMLEU\nsNwwYk2QdOqB0oB3oFFPc3aCKUSIxApXLOXXeS2SUuu1boTDM6kM4mpHhFwj\nv9kA2HEcJeUQ9g9pVpnQurF0DpPJucu0AZE9rHI5sx4yVN2s5Sz1WiJefZhf\nDedhgE1L6psfmeuNFrWu3AZYK7NfAPw8A9fJTevHsMMj30TkJgwME81sSuHQ\ntI5mrgftrwgoYYC9bk11LBSarK1LTexRTUIo+aTXV1vnqq+OAsWyZ+r5+zpg\netCt\r\n=M/NA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA2Ba8leDO86O6rvwNj1voizNcYa1buBLp+p82a8JpnaAiBU1Fh3JtahmBpWq1L4ZSWyaCgUaL4mLQ6Ge3j2qymh4A=="}],"size":6855,"noattachment":false,"key":"/firstline/-/firstline-1.3.1.tgz"},"maintainers":[{"name":"pensierinmusica","email":"alessandro@zanardi.org"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/firstline_1.3.1_1526948595912_0.9240245466432369"},"_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":1526948596803,"_cnpm_publish_time":1526948596803,"dist-tags":{"latest":"2.0.2"}}