{"name":"fs-readfile-promise","version":"2.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 --config node_modules/@shinnn/eslintrc-node/rc.json index.js test.js","test":"node --harmony_arrow_functions test.js","coverage":"node --harmony_arrow_functions node_modules/.bin/istanbul cover test.js","coveralls":"${npm_package_scripts_coverage} && istanbul-coveralls"},"license":"MIT","files":["index.js"],"keywords":["fs","read","file","promise","promises","then","thenable"],"dependencies":{"graceful-fs":"^3.0.7"},"devDependencies":{"@shinnn/eslintrc-node":"^1.0.2","eslint":"^0.21.2","istanbul":"^0.3.14","istanbul-coveralls":"^1.0.2","tape":"^4.0.0"},"gitHead":"84b9e600ba3498722ac0e2368bd0ed2dc66dd4f5","bugs":{"url":"https://github.com/shinnn/fs-readfile-promise/issues"},"homepage":"https://github.com/shinnn/fs-readfile-promise#readme","_id":"fs-readfile-promise@2.0.0","_shasum":"10fda59806c82bd0552b0657f68d8fa8836490c9","_from":".","_npmVersion":"2.10.1","_nodeVersion":"2.1.0","_npmUser":{"name":"shinnn","email":"snnskwtnb@gmail.com"},"maintainers":[{"name":"shinnn","email":"snnskwtnb@gmail.com"}],"dist":{"shasum":"10fda59806c82bd0552b0657f68d8fa8836490c9","tarball":"http://registry-npm.ywwl.com/fs-readfile-promise/download/fs-readfile-promise-2.0.0.tgz","integrity":"sha512-0WkAE+Ac/vHAKivIz8oIM7rR1nCh/wgsIB4fGSaqj1f44lCDpO1l2cvb5gKBud2/TMc8R6PMTi3ExO9XHut6pw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCxUs8Ceuh4DN2rVebheCE4YXJ12YQr7UChkB8DpUtdIAIhANTGv2KdbO7+1Zj2yrNI3xwZYFGIho0hRMKlpwDdGIdp"}],"size":2396,"noattachment":false,"key":"/fs-readfile-promise/-/fs-readfile-promise-2.0.0.tgz"},"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":1432959575089,"_cnpm_publish_time":1432959575089,"dist-tags":{"latest":"3.0.1","next":"4.0.0-2"}}