{"name":"koa-send","version":"2.0.3","keywords":["koa","file","static","sendfile"],"license":"MIT","_id":"koa-send@2.0.3","maintainers":[{"name":"aheckmann","email":"aaron.heckmann+github@gmail.com"},{"name":"coderhaoxin","email":"haoxins@outlook.com"},{"name":"dead_horse","email":"dead_horse@qq.com"},{"name":"eivifj","email":"eivind.fjeldstad@gmail.com"},{"name":"fengmk2","email":"fengmk2@gmail.com"},{"name":"jonathanong","email":"jonathanrichardong@gmail.com"},{"name":"jongleberry","email":"jonathanrichardong@gmail.com"},{"name":"juliangruber","email":"julian@juliangruber.com"},{"name":"tjholowaychuk","email":"tj@vision-media.ca"}],"homepage":"https://github.com/koajs/send#readme","bugs":{"url":"https://github.com/koajs/send/issues"},"dist":{"shasum":"7fd3cf3ce1418bade376a84cea4ec31d8f49cf07","tarball":"https://registry.npmjs.org/koa-send/-/koa-send-2.0.3.tgz","fileCount":4,"integrity":"sha512-fX69m+IqgXT4ZgBMsGVsMMB5tLYs9Sa1MhQLyau0n5Qetq5003aaFoCY/YpPL4M+WA7fpJfFk6aEArNzGP0Q3w==","signatures":[{"sig":"MEUCIDi/t/yPyJED+f659rr4LXXOzGWrNlbf0rkk42gTougHAiEA5YSn/gYHzLq6erVwek0xM/12a9WBNOI1UL87CoMPing=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":8328,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbmMlXCRA9TVsSAnZWagAAa8MP/RgImKQxXrf03Mc0B+Jw\nnOgotgb46lbln52RKkeksF9JN2IIrJjs3Hdp4TtBLNEKrA7RlaGDjTG3ArC7\nmIhwJiRn8/+l9lOOYUMhlYQEHzsv0k1jF6NLXo/oVF+EY2VVVf3JQfm+9lqZ\nVcM6m0fpz9Yr14XhJxCqF5vKBqoZLO7jqqYQDhbFBgy39yUQe+j+J6MQT7ZY\nuIhBHgqCC73uDysUnh/zNt+JwjEmqnqv81Y3csS0gbxGEzPYrkOUCFvDLcvt\nKeq+L6W8kV/ALocE4uh7yMwchT/gZnhlhpdZh9V47vtd2k9TdYu6CqegHmFj\nysR5LGttINh1IH+3JRAFlTElx9n5cnlNDNJXY10rw+hrLT5L5j7XEHhEV++/\nFuDbcGFvnSBKkVfiON9+CkI5a83GJlJa1HsqaLhgCX/+JHUFF147MXxRi8Nt\nhQiO6ofK7Qsg25V329/khuggami5MdtkTcVWg+XyGtKbIwOCf1lUr5cyKBsY\nScUm+SAuITqnxSRIMrq+e+14wJXFnpU2jjBA5CxIYr5EVJtjHEntHpEQQVrp\nWvndsHoVynNvzsn23pppivZMjigXoAuhw1xHcjSeurZ/nxHAv++YALThSUCM\nT8n9mL1stqffBPNNoH0MvdqPIieUpdpz3N6mb40NNk9eMCzpL5gwM41bqw54\nmEHZ\r\n=zHc6\r\n-----END PGP SIGNATURE-----\r\n"},"readme":"\n# koa-send\n\n[![NPM version][npm-image]][npm-url]\n[![Build status][travis-image]][travis-url]\n[![Test coverage][coveralls-image]][coveralls-url]\n[![Dependency Status][david-image]][david-url]\n[![License][license-image]][license-url]\n[![Downloads][downloads-image]][downloads-url]\n\n Static file serving middleware.\n\n## Installation\n\n```js\n$ npm install koa-send\n```\n\n## Options\n\n - `maxage` Browser cache max-age in milliseconds. defaults to 0\n - `hidden` Allow transfer of hidden files. defaults to false\n - `root` Root directory to restrict file access\n - `gzip` Try to serve the gzipped version of a file automatically when `gzip` is supported by a client and if the requested file with `.gz` extension exists. defaults to true.\n - `format` If true, format the path to serve static file servers and not require a trailing slash for directories, so that you can do both `/directory` and `/directory/`\n\n## Root path\n\n  Note that `root` is required, defaults to `''` and will be resolved,\n  removing the leading `/` to make the path relative and this\n  path must not contain \"..\", protecting developers from\n  concatenating user input. If you plan on serving files based on\n  user input supply a `root` directory from which to serve from.\n\n  For example to serve files from `./public`:\n\n```js\napp.use(function *(){\n  yield send(this, this.path, { root: __dirname + '/public' });\n})\n```\n\n  To serve developer specified files:\n\n```js\napp.use(function *(){\n  yield send(this, 'path/to/my.js');\n})\n```\n\n## Example\n\n```js\nvar send = require('koa-send');\nvar koa = require('koa');\nvar app = koa();\n\n// $ GET /package.json\n// $ GET /\n\napp.use(function *(){\n  if ('/' == this.path) return this.body = 'Try GET /package.json';\n  yield send(this, __dirname + '/package.json');\n})\n\napp.listen(3000);\nconsole.log('listening on port 3000');\n```\n\n## License\n\n  MIT\n\n[npm-image]: https://img.shields.io/npm/v/koa-send.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/koa-send\n[github-tag]: http://img.shields.io/github/tag/koajs/send.svg?style=flat-square\n[github-url]: https://github.com/koajs/send/tags\n[travis-image]: https://img.shields.io/travis/koajs/send.svg?style=flat-square\n[travis-url]: https://travis-ci.org/koajs/send\n[coveralls-image]: https://img.shields.io/coveralls/koajs/send.svg?style=flat-square\n[coveralls-url]: https://coveralls.io/r/koajs/send?branch=master\n[david-image]: http://img.shields.io/david/koajs/send.svg?style=flat-square\n[david-url]: https://david-dm.org/koajs/send\n[license-image]: http://img.shields.io/npm/l/koa-send.svg?style=flat-square\n[license-url]: LICENSE\n[downloads-image]: http://img.shields.io/npm/dm/koa-send.svg?style=flat-square\n[downloads-url]: https://npmjs.org/package/koa-send\n[gittip-image]: https://img.shields.io/gittip/jonathanong.svg?style=flat-square\n[gittip-url]: https://www.gittip.com/jonathanong/\n","gitHead":"a02302ba334dc0ab77c0321e911ee5fc3fc90a31","scripts":{"test":"mocha --require should --reporter spec","test-cov":"node ./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha -- --require should","test-travis":"node ./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha --report lcovonly -- --require should"},"_npmUser":{"name":"fengmk2","email":"fengmk2@gmail.com"},"repository":{"url":"git+https://github.com/koajs/send.git","type":"git"},"_npmVersion":"6.4.1","description":"Transfer static files","directories":{},"_nodeVersion":"10.10.0","dependencies":{"mz":"^2.0.0","debug":"^3.2.5","resolve-path":"^1.2.1"},"publishConfig":{"tag":"latest-2"},"_hasShrinkwrap":false,"readmeFilename":"Readme.md","devDependencies":{"koa":"1","mocha":"^2.3.3","should":"3","supertest":"0","istanbul-harmony":"0"},"_npmOperationalInternal":{"tmp":"tmp/koa-send_2.0.3_1536739670535_0.9564221275426432","host":"s3://npm-registry-packages"}}