{"name":"fs-readfile-promise","version":"3.0.0","description":"Promise version of fs.readFile","repository":{"type":"git","url":"git+https://github.com/shinnn/fs-readfile-promise.git"},"author":{"name":"Shinnosuke Watanabe","url":"https://github.com/shinnn"},"scripts":{"pretest":"eslint --fix --config @shinnn/node index.js test.js","test":"node --strong_mode test.js","coverage":"node --strong_mode node_modules/.bin/istanbul cover test.js"},"license":"MIT","files":["index.js"],"keywords":["fs","read","file","promise","promises","then","thenable"],"dependencies":{"graceful-fs":"^4.1.2"},"devDependencies":{"@shinnn/eslint-config-node":"^2.0.0","eslint":"^2.10.0","istanbul":"^0.4.3","tape":"^4.5.1"},"gitHead":"b4de3a93bba8ad90fbca0393c0925b1ec3597e61","bugs":{"url":"https://github.com/shinnn/fs-readfile-promise/issues"},"homepage":"https://github.com/shinnn/fs-readfile-promise#readme","_id":"fs-readfile-promise@3.0.0","_shasum":"8f66593bc196e4b6c16f4a156c4fcd7cc31cafd3","_from":".","_npmVersion":"3.9.2","_nodeVersion":"5.9.1","_npmUser":{"name":"shinnn","email":"snnskwtnb@gmail.com"},"dist":{"shasum":"8f66593bc196e4b6c16f4a156c4fcd7cc31cafd3","tarball":"http://registry-npm.ywwl.com/fs-readfile-promise/download/fs-readfile-promise-3.0.0.tgz","integrity":"sha512-3pemX3h80rSC7GWswFfUJxrV7+52+zmw77PnGxG7v0hQTomZ+GXbhhPZnbTqkKNAvXsAjMQddn10FgbVWLwjkQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDXJ2myTwWHHLEKzTcYooZyeuJyZA/PqNYZN1Ul6r/mdAiEAqz8dK4yQLhoBPO4mqrH86/546CdCtg13AOoSnA9rCJk="}],"size":2312,"noattachment":false,"key":"/fs-readfile-promise/-/fs-readfile-promise-3.0.0.tgz"},"maintainers":[{"name":"shinnn","email":"snnskwtnb@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/fs-readfile-promise-3.0.0.tgz_1464172904278_0.6308276683557779"},"directories":{},"readme":"# fs-readfile-promise\n\n[![npm version](https://img.shields.io/npm/v/fs-readfile-promise.svg)](https://www.npmjs.com/package/fs-readfile-promise)\n[![Build Status](https://travis-ci.org/shinnn/fs-readfile-promise.svg?branch=master)](https://travis-ci.org/shinnn/fs-readfile-promise)\n[![Build status](https://ci.appveyor.com/api/projects/status/5sacvq0w9x7mwkwd?svg=true)](https://ci.appveyor.com/project/ShinnosukeWatanabe/fs-readfile-promise)\n[![Coverage Status](https://img.shields.io/coveralls/shinnn/fs-readfile-promise.svg)](https://coveralls.io/r/shinnn/fs-readfile-promise)\n\nPromisified version of [`fs.readFile`][fs.readfile]\n\n```javascript\nconst readFilePromise = require('fs-readfile-promise');\n\n(async () => {\n  const buffer = await readFile('path/to/a/file');\n  buffer.toString(); //=> '... file contents ...'\n})();\n```\n\nBased on the principle of [*modular programming*](https://en.wikipedia.org/wiki/Modular_programming), this module has only one functionality [`readFile`][fs.readfile], unlike other Promise-based file system modules. If you'd like to use a bunch of other [`fs`](http://nodejs.org/api/fs.html) methods in the Promise way, choose other modules such as [q-io](https://github.com/kriskowal/q-io) and [promise-fs](https://github.com/octet-stream/promise-fs).\n\n## Installation\n\n[Use](https://docs.npmjs.com/cli/install) [npm](https://docs.npmjs.com/getting-started/what-is-npm).\n\n```\nnpm install fs-readfile-promise\n```\n\n## API\n\n```javascript\nconst readFilePromise = require('fs-readfile-promise');\n```\n\n### readFile(*path* [, *options*])\n\n*path*: `string` `Buffer` `URL` `integer`  \n*options*: `Object` ([fs.readFile] options) or `string` (encoding)  \nReturn: `Promise<Buffer|string>`\n\n```javascript\n(async () => {\n  await readFilePromise('src.txt'); //=> <Buffer 48 69 2e>\n  await readFilePromise('src.txt', 'utf8'); //=> 'Hi.'\n  await readFilePromise('src.txt', {encoding: 'base64'}); //=> 'SGku'\n})();\n\n```\n\n## License\n\n[ISC License](./LICENSE) © 2017 Shinnosuke Watanabe\n\n[fs.readfile]: https://nodejs.org/api/fs.html#fs_fs_readfile_path_options_callback\n","publish_time":1464172906888,"_cnpm_publish_time":1464172906888,"dist-tags":{"latest":"3.0.1","next":"4.0.0-2"}}