{"id":13600784,"url":"https://github.com/venables/koa-helmet","last_synced_at":"2025-05-13T22:00:26.151Z","repository":{"id":15517541,"uuid":"18251855","full_name":"venables/koa-helmet","owner":"venables","description":"Important security headers for koa","archived":false,"fork":false,"pushed_at":"2025-04-09T14:47:45.000Z","size":968,"stargazers_count":643,"open_issues_count":3,"forks_count":41,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-05-07T23:36:28.610Z","etag":null,"topics":["headers","helmet","koa","koa-helmet","koa2","middleware","secure","secure-by-default"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/venables.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2014-03-29T22:04:48.000Z","updated_at":"2025-04-23T10:35:11.000Z","dependencies_parsed_at":"2024-01-15T18:46:10.468Z","dependency_job_id":"c0d9e8ec-d4de-48f0-b241-4a641fbdc83c","html_url":"https://github.com/venables/koa-helmet","commit_stats":{"total_commits":245,"total_committers":32,"mean_commits":7.65625,"dds":0.6612244897959183,"last_synced_commit":"4143936bffa9a6bbb3d25f837a26b19560d7cd77"},"previous_names":[],"tags_count":35,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/venables%2Fkoa-helmet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/venables%2Fkoa-helmet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/venables%2Fkoa-helmet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/venables%2Fkoa-helmet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/venables","download_url":"https://codeload.github.com/venables/koa-helmet/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253528958,"owners_count":21922634,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["headers","helmet","koa","koa-helmet","koa2","middleware","secure","secure-by-default"],"created_at":"2024-08-01T18:00:48.555Z","updated_at":"2025-05-13T22:00:26.087Z","avatar_url":"https://github.com/venables.png","language":"TypeScript","funding_links":[],"categories":["仓库","Node.js, koa","TypeScript","Koa Middlewares"],"sub_categories":["中间件","Utilites"],"readme":"# koa-helmet\n\n[![Version](https://img.shields.io/npm/v/koa-helmet.svg)](https://www.npmjs.com/package/koa-helmet)\n[![Downloads](https://img.shields.io/npm/dm/koa-helmet.svg)](https://www.npmjs.com/package/koa-helmet)\n\nkoa-helmet is a wrapper for [helmet](https://github.com/helmetjs/helmet) to work with [koa](https://github.com/koajs/koa). It provides important security headers to make your app more secure by default.\n\n## Installation\n\n```sh\nnpm i koa-helmet helmet\n\n# or:\n\nyarn add koa-helmet helmet\n```\n\n## Usage\n\nUsage is the same as [helmet](https://github.com/helmetjs/helmet)\n\nHelmet offers 11 security middleware functions:\n\n```js\n// This...\napp.use(helmet());\n\n// ...is equivalent to this:\napp.use(helmet.contentSecurityPolicy());\napp.use(helmet.dnsPrefetchControl());\napp.use(helmet.expectCt());\napp.use(helmet.frameguard());\napp.use(helmet.hidePoweredBy());\napp.use(helmet.hsts());\napp.use(helmet.ieNoOpen());\napp.use(helmet.noSniff());\napp.use(helmet.permittedCrossDomainPolicies());\napp.use(helmet.referrerPolicy());\napp.use(helmet.xssFilter());\n```\n\nYou can see more in [the documentation](https://helmetjs.github.io).\n\n## Example\n\n```js\nimport Koa from \"koa\";\nimport helmet from \"koa-helmet\";\n\nconst app = new Koa();\n\napp.use(helmet());\n\napp.use((ctx) =\u003e {\n  ctx.body = \"Hello World\";\n});\n\napp.listen(4000);\n```\n\n## Testing\n\nTo run the tests, simply run\n\n```\nnpm test\n```\n\n## Versioning\n\n- koa-helmet \u003e=2.x (master branch) supports koa 2.x\n- koa-helmet 1.x ([koa-1](https://github.com/venables/koa-helmet/tree/koa-1) branch) supports koa 0.x and koa 1.x\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvenables%2Fkoa-helmet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvenables%2Fkoa-helmet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvenables%2Fkoa-helmet/lists"}