{"_id":"koa-static-with-post","_rev":"1659831","name":"koa-static-with-post","description":"Static file serving middleware for koa","dist-tags":{"latest":"1.5.2"},"maintainers":[{"name":"sorrycc","email":"sorrycc@gmail.com"}],"time":{"modified":"2026-11-02T19:21:25.000Z","created":"2015-11-13T09:10:19.960Z","1.5.2":"2015-11-13T09:10:19.960Z"},"users":{},"repository":{"type":"git","url":"git+https://github.com/koajs/static.git"},"versions":{"1.5.2":{"name":"koa-static-with-post","description":"Static file serving middleware for koa","repository":{"type":"git","url":"git+https://github.com/koajs/static.git"},"version":"1.5.2","keywords":["koa","middleware","file","static","sendfile"],"files":["index.js"],"devDependencies":{"istanbul-harmony":"0","koa":"1","mocha":"2","supertest":"1"},"license":"MIT","dependencies":{"debug":"*","koa-send":"~2.0.1"},"scripts":{"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"},"gitHead":"fe1800a9e0737247a2fea23ecaa11273a9cb9780","bugs":{"url":"https://github.com/koajs/static/issues"},"homepage":"https://github.com/koajs/static#readme","_id":"koa-static-with-post@1.5.2","_shasum":"4e30fcf3b3de43e69fee78c5a138b28d6f5bb3d4","_from":".","_npmVersion":"2.12.1","_nodeVersion":"2.3.4","_npmUser":{"name":"sorrycc","email":"sorrycc@gmail.com"},"maintainers":[{"name":"sorrycc","email":"sorrycc@gmail.com"}],"dist":{"shasum":"4e30fcf3b3de43e69fee78c5a138b28d6f5bb3d4","tarball":"http://registry-npm.ywwl.com/koa-static-with-post/download/koa-static-with-post-1.5.2.tgz","integrity":"sha512-sQZZoTA7AQ9ZHgGtYV09zAYa7aR5YIE1ltlcJ2uhv/dQ9N8J7dnK+nYK/tQFVp62ohlmPZ6RrHCT93itPJ3u2Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDhp/QrbFMGf0Ah/U7Fljvj6TDifIK2NQAX3Lvv0I6f+QIga6jI1Hn9q5uE19rvCbgUPZUxENoNfdkbf1kCPktuHIk="}],"size":2278,"noattachment":false,"key":"/koa-static-with-post/-/koa-static-with-post-1.5.2.tgz"},"publish_time":1447405819960,"_cnpm_publish_time":1447405819960}},"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\n Static file serving middleware.\n\n## Installation\n\n```bash\n$ npm install koa-static\n```\n\n## API\n\n```js\nvar koa = require('koa');\nvar app = 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 `yield next`, allowing any downstream middleware to respond first.\n\n## Example\n\n```js\nvar serve = require('koa-static');\nvar koa = require('koa');\nvar app = 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## 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/koajs/static#readme","bugs":{"url":"https://github.com/koajs/static/issues"},"license":"MIT"}