{"name":"fs-readfile-promise","version":"0.0.0","description":"Promise version of fs.readFile","repository":{"type":"git","url":"https://github.com/shinnn/fs-readfile-promise"},"author":{"name":"Shinnosuke Watanabe","url":"https://github.com/shinnn"},"scripts":{"pretest":"eslint *.js & jscs *.js","test":"tape test.js | tap-spec"},"licenses":[{"type":"MIT","url":"https://github.com/shinnn/fs-readfile-promise/blob/master/LICENSE"}],"files":["index.js","LICENSE"],"keywords":["fs","read","file","promise","promises","then","thenable"],"dependencies":{"es6-promise":"^1.0.0"},"devDependencies":{"eslint":"^0.7.4","jscs":"^1.5.9","require-main":"^0.1.1","tap-spec":"^0.2.0","tape":"^2.14.0"},"gitHead":"09a5992ac2157f3e55a11dd140207f12bf3f7f93","bugs":{"url":"https://github.com/shinnn/fs-readfile-promise/issues"},"homepage":"https://github.com/shinnn/fs-readfile-promise","_id":"fs-readfile-promise@0.0.0","_shasum":"0713800b9903390ee723da5c2d48757edd315121","_from":".","_npmVersion":"2.0.0-alpha-5","_npmUser":{"name":"shinnn","email":"snnskwtnb@gmail.com"},"maintainers":[{"name":"shinnn","email":"snnskwtnb@gmail.com"}],"dist":{"shasum":"0713800b9903390ee723da5c2d48757edd315121","tarball":"http://registry-npm.ywwl.com/fs-readfile-promise/download/fs-readfile-promise-0.0.0.tgz","integrity":"sha512-wZav4YXuLyBHR3gcs5B4Ksb2TSQkB0TMeZwqSxeNqIO65FyZyj7pGKBWi4VeAtLZ/Dl6OUns689I76ijMCaLLQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICtTeG1/Zf/nfn4XkOBg8uK/a98jDghy73KsGlck61vnAiEAoR5T3zIxJc1wEBXDNNuuOfmmDLVlbv0Q0hJaZGLnG8I="}],"size":2271,"noattachment":false,"key":"/fs-readfile-promise/-/fs-readfile-promise-0.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":1407339072654,"_cnpm_publish_time":1407339072654,"dist-tags":{"latest":"3.0.1","next":"4.0.0-2"}}