{"name":"@eggjs/static","version":"4.0.2-beta.4","keywords":["egg","egg-plugin","eggPlugin","static"],"author":{"name":"dead_horse"},"license":"MIT","_id":"@eggjs/static@4.0.2-beta.4","maintainers":[{"name":"gxkl","email":"gxkl203@gmail.com"},{"name":"eggjs-admin","email":"fengmk2+eggjs@gmail.com"},{"name":"fengmk2","email":"fengmk2@gmail.com"},{"name":"atian25","email":"atian25@qq.com"},{"name":"hyj1991","email":"yeekwanvong@gmail.com"},{"name":"killagu","email":"killa07071201@gmail.com"},{"name":"coolme200","email":"2001-wms@163.com"},{"name":"akitasummer","email":"644171127@qq.com"},{"name":"niania","email":"ljracm@gmail.com"}],"homepage":"https://github.com/eggjs/egg/tree/next/plugins/static","bugs":{"url":"https://github.com/eggjs/egg/issues"},"dist":{"shasum":"27297490f36040ef6d025f0705a1fb7fc26f28ef","tarball":"http://registry-npm.ywwl.com/@eggjs/static/download/@eggjs/static-4.0.2-beta.4.tgz","fileCount":15,"integrity":"sha512-XVxUmXuRSwpxqvUFdwVKgycPuj9jKi5a/dL9m3DWNNx/RNm+dteaHkK0ZO+c5O0ZdGzIEUfTEpO4vH1jekuzVw==","signatures":[{"sig":"MEUCIQCnSl+gA4Rq3rISeqsBBqXXTeqashBDpTZjcM5ZKI4jGgIgUMm5dXB/zJmdxgOUm13w6s48jc3VOIgLXZw9QVt/7is=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@eggjs%2fstatic@4.0.2-beta.4","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":10901,"size":4447,"noattachment":false,"key":"/@eggjs/static/-/@eggjs/static-4.0.2-beta.4.tgz"},"main":"./dist/index.js","type":"module","_from":"file:eggjs-static-4.0.2-beta.4.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=22.18.0"},"exports":{".":"./dist/index.js","./app":"./dist/app.js","./types":"./dist/types.js","./package.json":"./package.json","./config/config.prod":"./dist/config/config.prod.js","./app/middleware/static":"./dist/app/middleware/static.js","./config/config.default":"./dist/config/config.default.js"},"scripts":{"typecheck":"tsgo --noEmit"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:bc398a0b-6a2f-42d7-8497-6463d46fd7ba"}},"_resolved":"/tmp/0c55c130727f112acfb6424f8edf4e5d/eggjs-static-4.0.2-beta.4.tgz","_integrity":"sha512-XVxUmXuRSwpxqvUFdwVKgycPuj9jKi5a/dL9m3DWNNx/RNm+dteaHkK0ZO+c5O0ZdGzIEUfTEpO4vH1jekuzVw==","repository":{"url":"git+https://github.com/eggjs/egg.git","type":"git","directory":"plugins/static"},"_npmVersion":"11.9.0","description":"static server plugin for egg","directories":{},"_nodeVersion":"24.14.0","dependencies":{"ylru":"^2.0.0","koa-range":"^0.3.0","koa-compose":"^4.1.0","@eggjs/koa-static-cache":"7.0.2-beta.4"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"egg":"4.1.2-beta.4","typescript":"^5.9.3","@eggjs/mock":"7.0.2-beta.4","@types/koa-range":"^0.3.5","@types/koa-compose":"^3.2.8"},"peerDependencies":{"egg":"4.1.2-beta.4"},"_npmOperationalInternal":{"tmp":"tmp/static_4.0.2-beta.4_1773327709993_0.5417032044662091","host":"s3://npm-registry-packages-npm-production"},"readme":"# @eggjs/static\n\n[![NPM version][npm-image]][npm-url]\n[![Known Vulnerabilities][snyk-image]][snyk-url]\n[![npm download][download-image]][download-url]\n[![Node.js Version](https://img.shields.io/node/v/@eggjs/static.svg?style=flat)](https://nodejs.org/en/download/)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://makeapullrequest.com)\n\n[npm-image]: https://img.shields.io/npm/v/@eggjs/static.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/@eggjs/static\n[snyk-image]: https://snyk.io/test/npm/@eggjs/static/badge.svg?style=flat-square\n[snyk-url]: https://snyk.io/test/npm/@eggjs/static\n[download-image]: https://img.shields.io/npm/dm/@eggjs/static.svg?style=flat-square\n[download-url]: https://npmjs.org/package/@eggjs/static\n\nStatic server plugin for egg, base on [@eggjs/koa-static-cache](https://github.com/eggjs/egg/tree/next/packages/koa-static-cache).\n\n## Install\n\n`@eggjs/static` is a plugin that has been built-in for egg. It is enabled by default.\n\n## Configuration\n\n`@eggjs/static` support all configurations in [@eggjs/koa-static-cache](https://github.com/eggjs/egg/tree/next/packages/koa-static-cache).\nAnd with default configurations below:\n\n- prefix: `'/public/'`\n- dir: `path.join(appInfo.baseDir, 'app/public')`\n- dynamic: `true`\n- preload: `false`\n- maxAge: `31536000` in prod env, `0` in other envs\n- buffer: `true` in prod env, `false` in other envs\n\n`@eggjs/static` provides one more option:\n\n- maxFiles: the maximum value of cache items, only effective when dynamic is true, default is `1000`.\n\n**All static files in `$baseDir/app/public` can be visited with prefix `/public`, and all the files are lazy loaded.**\n\n- In non-production environment, assets won't be cached, your modification can take effect immediately.\n- In production environment, `@eggjs/static` will cache the assets after visited, you need to restart the process to update the assets.\n- Dir default is `$baseDir/app/public` but you can also define **multiple directory** by use `dir: [dir1, dir2, ...]` or `dir: [dir1, { prefix: '/static2', dir: dir2 }]`, static server will use all these directories.\n\n```ts\n// {app_root}/config/config.default.ts\nexport default {\n  static: {\n    // maxAge: 31536000,\n  },\n};\n```\n\n## Questions & Suggestions\n\nPlease open an issue [here](https://github.com/eggjs/egg/issues).\n\n## License\n\n[MIT](LICENSE)\n\n## Contributors\n\n[![Contributors](https://contrib.rocks/image?repo=eggjs/egg)](https://github.com/eggjs/egg/graphs/contributors)\n\nMade with [contributors-img](https://contrib.rocks).\n","publish_time":1773327710172,"_cnpm_publish_time":1773327710172,"dist-tags":{"beta":"4.0.2-beta.27","latest":"4.1.0","rc":"4.0.2-rc.1"}}