{"name":"fs-readfile-promise","version":"3.0.1","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 --format=codeframe index.js test.js","test":"nyc node test.js"},"license":"ISC","files":["index.js"],"keywords":["fs","read","file","promise","promises","then","thenable"],"dependencies":{"graceful-fs":"^4.1.11"},"devDependencies":{"@shinnn/eslint-config-node":"^5.0.0","eslint":"^4.14.0","nyc":"^11.4.1","tape":"^4.8.0"},"eslintConfig":{"extends":"@shinnn/node"},"gitHead":"13afdb1ef6c33c34288f892777852d252a9bce6d","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.1","_npmVersion":"5.6.0","_nodeVersion":"9.3.0","_npmUser":{"name":"shinnn","email":"snnskwtnb@gmail.com"},"dist":{"integrity":"sha512-LsSxMeaJdYH27XrW7Dmq0Gx63mioULCRel63B5VeELYLavi1wF5s0XfsIdKDFdCL9hsfQ2qBvXJszQtQJ9h17A==","shasum":"d0d307b7f6aedfc920c31fa6e5712efaa297c958","tarball":"http://registry-npm.ywwl.com/fs-readfile-promise/download/fs-readfile-promise-3.0.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCo1ID37Bs5XLNWyDXeczeU2feYpamo5yNhkK9EV+9B3gIhAPl0Kk+PxbKVegLm5dLl1V0JhIfMpMMQl0VVJDKJNBKv"}],"size":2008,"noattachment":false,"key":"/fs-readfile-promise/-/fs-readfile-promise-3.0.1.tgz"},"maintainers":[{"name":"shinnn","email":"snnskwtnb@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fs-readfile-promise-3.0.1.tgz_1514264045838_0.6409217661712319"},"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":1514264045964,"_cnpm_publish_time":1514264045964,"dist-tags":{"latest":"3.0.1","next":"4.0.0-2"}}