{"_id":"@shellscape/koa-static","_rev":"402180","name":"@shellscape/koa-static","description":"Static file serving middleware for koa","dist-tags":{"latest":"4.0.5"},"maintainers":[{"name":"shellscape","email":""}],"time":{"modified":"2021-08-04T04:34:40.000Z","created":"2018-02-12T01:33:40.510Z","4.0.5":"2018-03-31T02:20:03.769Z","4.0.4":"2018-02-12T01:56:04.613Z","4.0.3":"2018-02-12T01:40:36.568Z","4.0.2":"2018-02-12T01:33:40.510Z"},"users":{},"repository":{"type":"git","url":"git+https://github.com/shellscape/koa-static.git"},"versions":{"4.0.5":{"name":"@shellscape/koa-static","description":"Static file serving middleware for koa","repository":{"type":"git","url":"git+https://github.com/shellscape/koa-static.git"},"version":"4.0.5","keywords":["koa","middleware","file","static","sendfile"],"files":["index.js","legacy/index.js"],"publishConfig":{"access":"public"},"devDependencies":{"@babel/cli":"^7.0.0-beta.39","@babel/core":"^7.0.0-beta.39","@babel/polyfill":"^7.0.0-beta.39","@babel/preset-env":"^7.0.0-beta.39","@babel/register":"^7.0.0-beta.39","babel-plugin-module-resolver":"^3.0.0","eslint":"^4.1.1","eslint-config-standard":"^10.2.1","eslint-plugin-import":"^2.6.1","eslint-plugin-node":"^5.1.0","eslint-plugin-promise":"^3.5.0","eslint-plugin-standard":"^3.0.1","istanbul":"^0.4.5","koa":"^2.3.0","mocha":"^3.4.2","supertest":"^3.0.0"},"license":"MIT","dependencies":{"debug":"^2.6.8","@shellscape/koa-send":"^4.1.0"},"scripts":{"lint":"eslint --fix .","prepublishOnly":"babel index.js --out-file legacy/index.js","test":"npm run prepublishOnly && mocha --harmony --reporter spec","test-cov":"node --harmony ./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha","test-travis":"node --harmony ./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha --report lcovonly"},"engines":{"node":">= 6"},"gitHead":"e9156750aee7eabd38e8cb90059c5c4817adb4ef","bugs":{"url":"https://github.com/shellscape/koa-static/issues"},"homepage":"https://github.com/shellscape/koa-static#readme","_id":"@shellscape/koa-static@4.0.5","_npmVersion":"5.6.0","_nodeVersion":"9.2.0","_npmUser":{"name":"shellscape","email":"andrew@shellscape.org"},"dist":{"shasum":"b329b55bfd41056a6981c584ae6bace30b5b6b3b","size":3658,"noattachment":false,"key":"/@shellscape/koa-static/-/@shellscape/koa-static-4.0.5.tgz","tarball":"http://registry.cnpm.dingdandao.com/@shellscape/koa-static/download/@shellscape/koa-static-4.0.5.tgz"},"maintainers":[{"name":"shellscape","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/koa-static_4.0.5_1522462803662_0.9853020396558372"},"_hasShrinkwrap":false,"publish_time":1522462803769,"_cnpm_publish_time":1522462803769},"4.0.4":{"name":"@shellscape/koa-static","description":"Static file serving middleware for koa","repository":{"type":"git","url":"git+https://github.com/shellscape/koa-static.git"},"version":"4.0.4","keywords":["koa","middleware","file","static","sendfile"],"files":["index.js","legacy/index.js"],"publishConfig":{"access":"public"},"devDependencies":{"@babel/cli":"^7.0.0-beta.39","@babel/core":"^7.0.0-beta.39","@babel/polyfill":"^7.0.0-beta.39","@babel/preset-env":"^7.0.0-beta.39","@babel/register":"^7.0.0-beta.39","babel-plugin-module-resolver":"^3.0.0","eslint":"^4.1.1","eslint-config-standard":"^10.2.1","eslint-plugin-import":"^2.6.1","eslint-plugin-node":"^5.1.0","eslint-plugin-promise":"^3.5.0","eslint-plugin-standard":"^3.0.1","istanbul":"^0.4.5","koa":"^2.3.0","mocha":"^3.4.2","supertest":"^3.0.0"},"license":"MIT","dependencies":{"debug":"^2.6.8","@shellscape/koa-send":"^4.1.0"},"scripts":{"lint":"eslint --fix .","prepublishOnly":"babel index.js --out-file legacy/index.js","test":"npm run prepublishOnly && mocha --harmony --reporter spec","test-cov":"node --harmony ./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha","test-travis":"node --harmony ./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha --report lcovonly"},"engines":{"node":">= 7.6.0"},"gitHead":"a3c93b32f9af5fa55677063954a0d471505fc247","bugs":{"url":"https://github.com/shellscape/koa-static/issues"},"homepage":"https://github.com/shellscape/koa-static#readme","_id":"@shellscape/koa-static@4.0.4","_npmVersion":"5.6.0","_nodeVersion":"9.2.0","_npmUser":{"name":"shellscape","email":"andrew@shellscape.org"},"dist":{"shasum":"38b569dfad3ce04c43391bed68f5f3b4af0294bb","size":3658,"noattachment":false,"key":"/@shellscape/koa-static/-/@shellscape/koa-static-4.0.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/@shellscape/koa-static/download/@shellscape/koa-static-4.0.4.tgz"},"maintainers":[{"name":"shellscape","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/koa-static_4.0.4_1518400563805_0.8060085869869555"},"_hasShrinkwrap":false,"publish_time":1518400564613,"_cnpm_publish_time":1518400564613},"4.0.3":{"name":"@shellscape/koa-static","description":"Static file serving middleware for koa","repository":{"type":"git","url":"git+https://github.com/shellscape/koa-static.git"},"version":"4.0.3","keywords":["koa","middleware","file","static","sendfile"],"files":["index.js","legacy/index.js"],"publishConfig":{"access":"public"},"devDependencies":{"@babel/cli":"^7.0.0-beta.39","@babel/core":"^7.0.0-beta.39","@babel/polyfill":"^7.0.0-beta.39","@babel/preset-env":"^7.0.0-beta.39","@babel/register":"^7.0.0-beta.39","eslint":"^4.1.1","eslint-config-standard":"^10.2.1","eslint-plugin-import":"^2.6.1","eslint-plugin-node":"^5.1.0","eslint-plugin-promise":"^3.5.0","eslint-plugin-standard":"^3.0.1","istanbul":"^0.4.5","koa":"^2.3.0","mocha":"^3.4.2","supertest":"^3.0.0"},"license":"MIT","dependencies":{"debug":"^2.6.8","@shellscape/koa-send":"^4.1.0"},"scripts":{"lint":"eslint --fix .","prepublishOnly":"babel index.js --out-file legacy/index.js","test":"npm run prepublishOnly && mocha --harmony --reporter spec","test-cov":"node --harmony ./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha","test-travis":"node --harmony ./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha --report lcovonly"},"engines":{"node":">= 7.6.0"},"gitHead":"a3c93b32f9af5fa55677063954a0d471505fc247","bugs":{"url":"https://github.com/shellscape/koa-static/issues"},"homepage":"https://github.com/shellscape/koa-static#readme","_id":"@shellscape/koa-static@4.0.3","_npmVersion":"5.6.0","_nodeVersion":"9.2.0","_npmUser":{"name":"shellscape","email":"andrew@shellscape.org"},"dist":{"shasum":"84607e40a3cfbc1b00fb0294a1030f371caf75fc","size":3643,"noattachment":false,"key":"/@shellscape/koa-static/-/@shellscape/koa-static-4.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/@shellscape/koa-static/download/@shellscape/koa-static-4.0.3.tgz"},"maintainers":[{"name":"shellscape","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/koa-static_4.0.3_1518399635904_0.791132568346117"},"_hasShrinkwrap":false,"publish_time":1518399636568,"_cnpm_publish_time":1518399636568},"4.0.2":{"name":"@shellscape/koa-static","description":"Static file serving middleware for koa","repository":{"type":"git","url":"git+https://github.com/shellscape/koa-static.git"},"version":"4.0.2","keywords":["koa","middleware","file","static","sendfile"],"files":["index.js","legacy/index.js"],"publishConfig":{"access":"public"},"devDependencies":{"@babel/cli":"^7.0.0-beta.39","@babel/core":"^7.0.0-beta.39","@babel/polyfill":"^7.0.0-beta.39","@babel/preset-env":"^7.0.0-beta.39","@babel/register":"^7.0.0-beta.39","eslint":"^4.1.1","eslint-config-standard":"^10.2.1","eslint-plugin-import":"^2.6.1","eslint-plugin-node":"^5.1.0","eslint-plugin-promise":"^3.5.0","eslint-plugin-standard":"^3.0.1","istanbul":"^0.4.5","koa":"^2.3.0","mocha":"^3.4.2","supertest":"^3.0.0"},"license":"MIT","dependencies":{"debug":"^2.6.8","koa-send":"^4.1.0"},"scripts":{"lint":"eslint --fix .","prepublishOnly":"babel index.js --out-file legacy/index.js","test":"mocha --harmony --reporter spec","test-cov":"node --harmony ./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha","test-travis":"node --harmony ./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha --report lcovonly"},"engines":{"node":">= 7.6.0"},"gitHead":"2389a8d496cc145d8aa9cc826d76dad71f96c672","bugs":{"url":"https://github.com/shellscape/koa-static/issues"},"homepage":"https://github.com/shellscape/koa-static#readme","_id":"@shellscape/koa-static@4.0.2","_npmVersion":"5.6.0","_nodeVersion":"9.2.0","_npmUser":{"name":"shellscape","email":"andrew@shellscape.org"},"dist":{"shasum":"651019bc68d157b9f0c62384dc34670b6cbed025","size":3617,"noattachment":false,"key":"/@shellscape/koa-static/-/@shellscape/koa-static-4.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/@shellscape/koa-static/download/@shellscape/koa-static-4.0.2.tgz"},"maintainers":[{"name":"shellscape","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/koa-static_4.0.2_1518399219672_0.80879370793531"},"_hasShrinkwrap":false,"publish_time":1518399220510,"_cnpm_publish_time":1518399220510}},"readme":"# koa-static\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 Koa static file serving middleware, wrapper for [`koa-send`](https://github.com/koajs/send).\n\n## Installation\n\n```bash\n$ npm install koa-static\n```\n\n## API\n\n```js\nconst Koa = require('koa');\nconst app = new Koa();\napp.use(require('koa-static')(root, opts));\n```\n\n* `root` root directory string. nothing above this root directory can be served\n* `opts` options object.\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 - `index` Default file name, defaults to 'index.html'\n - `defer` If true, serves after `return next()`, allowing any downstream middleware to respond first.\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 - `br`  Try to serve the brotli version of a file automatically when brotli is supported by a client and if the requested file with .br extension exists (note, that brotli is only accepted over https). defaults to true.\n - [setHeaders](https://github.com/koajs/send#setheaders) Function to set custom headers on response.\n - `extensions` Try to match extensions from passed array to search for file when no extension is sufficed in URL. First found is served. (defaults to `false`)\n\n## Example\n\n```js\nconst serve = require('koa-static');\nconst Koa = require('koa');\nconst app = new Koa();\n\n// $ GET /package.json\napp.use(serve('.'));\n\n// $ GET /hello.txt\napp.use(serve('test/fixtures'));\n\n// or use absolute paths\napp.use(serve(__dirname + '/test/fixtures'));\n\napp.listen(3000);\n\nconsole.log('listening on port 3000');\n```\n\n### See also\n\n - [koajs/conditional-get](https://github.com/koajs/conditional-get) Conditional GET support for koa\n - [koajs/compress](https://github.com/koajs/compress) Compress middleware for koa\n - [koajs/mount](https://github.com/koajs/mount) Mount `koa-static` to a specific path\n\n## License\n\n  MIT\n\n[npm-image]: https://img.shields.io/npm/v/koa-static.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/koa-static\n[github-tag]: http://img.shields.io/github/tag/koajs/static.svg?style=flat-square\n[github-url]: https://github.com/koajs/static/tags\n[travis-image]: https://img.shields.io/travis/koajs/static.svg?style=flat-square\n[travis-url]: https://travis-ci.org/koajs/static\n[coveralls-image]: https://img.shields.io/coveralls/koajs/static.svg?style=flat-square\n[coveralls-url]: https://coveralls.io/r/koajs/static?branch=master\n[david-image]: http://img.shields.io/david/koajs/static.svg?style=flat-square\n[david-url]: https://david-dm.org/koajs/static\n[license-image]: http://img.shields.io/npm/l/koa-static.svg?style=flat-square\n[license-url]: LICENSE\n[downloads-image]: http://img.shields.io/npm/dm/koa-static.svg?style=flat-square\n[downloads-url]: https://npmjs.org/package/koa-static\n[gittip-image]: https://img.shields.io/gittip/jonathanong.svg?style=flat-square\n[gittip-url]: https://www.gittip.com/jonathanong/\n","_attachments":{},"homepage":"https://github.com/shellscape/koa-static#readme","bugs":{"url":"https://github.com/shellscape/koa-static/issues"},"license":"MIT"}