{"id":18368190,"url":"https://github.com/thinkjs/think-helmet","last_synced_at":"2025-04-10T19:37:09.015Z","repository":{"id":73609597,"uuid":"107748306","full_name":"thinkjs/think-helmet","owner":"thinkjs","description":"Important security headers for ThinkJS 3","archived":false,"fork":false,"pushed_at":"2019-04-17T09:08:07.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-03-16T18:56:51.903Z","etag":null,"topics":["helmet","thinkjs"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/thinkjs.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}},"created_at":"2017-10-21T03:28:31.000Z","updated_at":"2019-04-17T09:08:10.000Z","dependencies_parsed_at":"2023-11-15T16:30:47.648Z","dependency_job_id":null,"html_url":"https://github.com/thinkjs/think-helmet","commit_stats":{"total_commits":14,"total_committers":3,"mean_commits":4.666666666666667,"dds":0.2142857142857143,"last_synced_commit":"359c72961efaa8469a5f865d4641c0505b0e58c1"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thinkjs%2Fthink-helmet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thinkjs%2Fthink-helmet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thinkjs%2Fthink-helmet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thinkjs%2Fthink-helmet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thinkjs","download_url":"https://codeload.github.com/thinkjs/think-helmet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248281415,"owners_count":21077423,"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":["helmet","thinkjs"],"created_at":"2024-11-05T23:24:59.010Z","updated_at":"2025-04-10T19:37:08.983Z","avatar_url":"https://github.com/thinkjs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# think-helmet\n\n[![npm](https://img.shields.io/npm/v/think-helmet.svg?style=flat-square)]()\n[![Travis](https://img.shields.io/travis/thinkjs/think-helmet.svg?style=flat-square)]()\n[![Coveralls](https://img.shields.io/coveralls/thinkjs/think-helmet/master.svg?style=flat-square)]()\n[![David](https://img.shields.io/david/thinkjs/think-helmet.svg?style=flat-square)]()\n\nthink-helmet is a wrapper for [helmet](https://github.com/helmetjs/helmet) to work with ThinkJS 3.x. It provides important security headers to make your app more secure by default.\n\n## Installation\n\n```\nnpm install think-helmet --save\n```\n\n## Usage\n\n```js\n// src/config/middleware.js\nmodule.exports = [{\n  handle: require('think-helmet'),\n  options: {\n\n  }\n}]\n```\n\nHelmet offers 11 security headers:\n\n| Module | Default? |\n|---|---|\n| [contentSecurityPolicy](https://helmetjs.github.io/docs/csp/) for setting Content Security Policy |  |\n| [dnsPrefetchControl](https://helmetjs.github.io/docs/dns-prefetch-control) controls browser DNS prefetching | ✓ |\n| [frameguard](https://helmetjs.github.io/docs/frameguard/) to prevent clickjacking | ✓ |\n| [hidePoweredBy](https://helmetjs.github.io/docs/hide-powered-by) to remove the X-Powered-By header | ✓ |\n| [hpkp](https://helmetjs.github.io/docs/hpkp/) for HTTP Public Key Pinning |  |\n| [hsts](https://helmetjs.github.io/docs/hsts/) for HTTP Strict Transport Security | ✓ |\n| [ieNoOpen](https://helmetjs.github.io/docs/ienoopen) sets X-Download-Options for IE8+ | ✓ |\n| [noCache](https://helmetjs.github.io/docs/nocache/) to disable client-side caching |  |\n| [noSniff](https://helmetjs.github.io/docs/dont-sniff-mimetype) to keep clients from sniffing the MIME type | ✓ |\n| [referrerPolicy](https://helmetjs.github.io/docs/referrer-policy) to hide the Referer header |  |\n| [xssFilter](https://helmetjs.github.io/docs/xss-filter) adds some small XSS protections | ✓ |\n\nYou can see more in [the documentation](https://helmetjs.github.io/docs/).\n\nNote:\n-----\n\nIn order to work well with the helmet HSTS module, think-helmet will augment\n`this.request` to include a `secure` boolean to determine if the request\nis over HTTPS.\n\n## Examples\n\n```js\n// src/config/middleware.js\nmodule.exports = [{\n  handle: require('think-helmet'),\n  options: {\n    contentSecurityPolicy: { // set content security policy directives\n      directives: {\n        defaultSrc: [\"'self'\"],\n        styleSrc: [\"'self'\", 'maxcdn.bootstrapcdn.com']\n      }\n    },\n    dnsPrefetchControl: false // disable dns prefetch control\n  }\n}]\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthinkjs%2Fthink-helmet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthinkjs%2Fthink-helmet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthinkjs%2Fthink-helmet/lists"}