{"name":"fs-readfile-promise","version":"2.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 --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":"^4.1.2"},"devDependencies":{"@shinnn/eslintrc-node":"^1.0.2","eslint":"^0.24.0","istanbul":"^0.3.17","istanbul-coveralls":"^1.0.3","tape":"^4.0.0"},"gitHead":"4036c226774f54833a96a4a9a1c5a82a3a8e8e3f","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.1","_shasum":"80023823981f9ffffe01609e8be668f69ae49e70","_from":".","_npmVersion":"2.12.1","_nodeVersion":"2.3.3","_npmUser":{"name":"shinnn","email":"snnskwtnb@gmail.com"},"maintainers":[{"name":"shinnn","email":"snnskwtnb@gmail.com"}],"dist":{"shasum":"80023823981f9ffffe01609e8be668f69ae49e70","tarball":"http://registry-npm.ywwl.com/fs-readfile-promise/download/fs-readfile-promise-2.0.1.tgz","integrity":"sha512-7+P9eOOMnkIOmtxrBWTzWOBQlE7Nz/cBx9EYTX5hm8DzmZ/Fj9YWeUY2O9G+Q8YblScd1hyEkcmNcZMDj5U8Ug==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD3qkGGthkALrkGbtvtmJ5neZJOdU91xuhOLeSTReGwqwIhAJMB589PeVSphsSb2Vh022QxWRccVoxDBFR2ZKgOt6MS"}],"size":2405,"noattachment":false,"key":"/fs-readfile-promise/-/fs-readfile-promise-2.0.1.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":1436300629446,"_cnpm_publish_time":1436300629446,"dist-tags":{"latest":"3.0.1","next":"4.0.0-2"}}