{"name":"@eggjs/static","version":"3.0.0","keywords":["egg","egg-plugin","eggPlugin","static"],"author":{"name":"dead_horse"},"license":"MIT","_id":"@eggjs/static@3.0.0","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":"dead_horse","email":"dead_horse@qq.com"},{"name":"wanghx","email":"whxaxes@gmail.com"},{"name":"hyj1991","email":"yeekwanvong@gmail.com"},{"name":"killagu","email":"killa07071201@gmail.com"},{"name":"coolme200","email":"2001-wms@163.com"},{"name":"mansonchor.zzw","email":"mansonchor1987@gmail.com"},{"name":"hubcarl","email":"hubcarl@126.com"},{"name":"gemwuu","email":"gemwuu@gmail.com"},{"name":"akitasummer","email":"644171127@qq.com"}],"homepage":"https://github.com/eggjs/static#readme","bugs":{"url":"https://github.com/eggjs/static/issues"},"dist":{"shasum":"2c215893bf8a217758580d2e6accf361f0f2ea05","tarball":"http://registry-npm.ywwl.com/@eggjs/static/download/@eggjs/static-3.0.0.tgz","fileCount":37,"integrity":"sha512-Wch3TYzjxYZp2Cm9/V8gqCn5Th++PzRjFVJkcrlnm3sQt61p9iXtSIlK5Yimx0l08IdZOIgTfLy0t4JL/G3bIg==","signatures":[{"sig":"MEUCIQDQu3pAN0Z574sSaD73TJSaRCLhTqkpk5+jZIvnlPCAtwIgcEUEWPxQIXr3mUx6G3ln62q/3ekgQGvIyT58PnM7Q74=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@eggjs%2fstatic@3.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":32277,"size":9154,"noattachment":false,"key":"/@eggjs/static/-/@eggjs/static-3.0.0.tgz"},"main":"./dist/commonjs/index.js","tshy":{"exports":{".":"./src/index.ts","./package.json":"./package.json"}},"type":"module","types":"./dist/commonjs/index.d.ts","module":"./dist/esm/index.js","engines":{"node":">= 18.19.0"},"exports":{".":{"import":{"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.js"}},"./package.json":"./package.json"},"gitHead":"8ab94aa816abec7421658816650dd1a3c805e4fc","scripts":{"ci":"egg-bin cov","lint":"eslint --cache src test --ext .ts","test":"egg-bin test","clean":"rimraf dist","preci":"npm run clean &&  npm run lint","postci":"npm run prepublishOnly && npm run clean","pretest":"npm run clean && npm run lint -- --fix","prepublishOnly":"tshy && tshy-after && attw --pack"},"_npmUser":{"name":"fengmk2","email":"fengmk2@gmail.com"},"eggPlugin":{"name":"static","exports":{"import":"./dist/esm","require":"./dist/commonjs","typescript":"./src"}},"repository":{"url":"git+https://github.com/eggjs/static.git","type":"git"},"_npmVersion":"10.8.2","description":"static server plugin for egg","directories":{},"_nodeVersion":"20.18.1","dependencies":{"ylru":"^2.0.0","koa-range":"^0.3.0","is-type-of":"^2.2.0","@eggjs/core":"^6.2.13","koa-compose":"^4.1.0","@eggjs/koa-static-cache":"^6.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"egg":"4","tshy":"3","eslint":"8","rimraf":"6","@eggjs/bin":"7","tshy-after":"1","typescript":"5","@eggjs/mock":"^6.0.5","@types/node":"22","@types/mocha":"10","@eggjs/tsconfig":"1","@types/koa-range":"^0.3.5","eslint-config-egg":"14","@types/koa-compose":"^3.2.8","@arethetypeswrong/cli":"^0.17.1"},"_npmOperationalInternal":{"tmp":"tmp/static_3.0.0_1736695536632_0.08020727239044367","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":1736695536826,"_cnpm_publish_time":1736695536826,"dist-tags":{"beta":"4.0.2-beta.27","latest":"4.1.0","rc":"4.0.2-rc.1"}}