Helmet
A strong pick. 2nd of 10 web security libraries.
Helmet is a small Express/Connect middleware with no dependencies. One call sets about a dozen sensible HTTP security headers, including a configurable Content-Security-Policy. For Node servers it remains the default way to set security headers, though it covers only the header part of this category's job.
Best for: Express, NestJS or Fastify (via @fastify/helmet) apps that want safe default security headers and a configurable CSP from one line of code.
Scores
Overall8.2
How strongly do we recommend it for a new project today?
Claude Opus 5.5: 8.0, likely 7.0 to 8.5
For Node servers built on Express, NestJS or Fastify, Helmet is the default way to set security headers. It is well made, safe, widely recommended and still maintained. It falls short of 9 because it is narrow: rate limiting, CORS and sanitizing need other peers, and modern framework or edge stacks often skip it. One main maintainer is a further risk.
- expressjs.com/en/advanced/best-practice-security.html: Official recommendation
- helmet.js.org/faq/you-might-not-need-helmet: Headers can be set by hand; Helmet is a convenience
- npm downloadsLast4Weeks: Steady at the median growth rate
GPT-6.2 Sol: 8.3, likely 7.2 to 9.3
Helmet is a strong pick for security headers in a new Express app because its defaults are useful, it remains maintained, and it brings in no runtime dependencies. Use express-rate-limit for request throttling and DOMPurify for HTML sanitization when those jobs are in scope. The main uncertainties are how much CSP tuning a particular app needs and how broadly release work is shared.
- expressjs.com/en/advanced/best-practice-security: Express recommends Helmet for setting production security headers.
- github.com/helmetjs/helmet/blob/main/CHANGELOG.md: The current release improves CSP handling and diagnostics.
- helmet.js.org: Documents the header scope, defaults, and configuration requirements.
- peers: The category includes specialists in rate limiting and HTML sanitization.
- npm dependencies: Installing Helmet adds no runtime dependencies.
- socket.dev/npm/package/helmet/versions: Recent publishes are concentrated in one account.
Needed by many5.9
How many developers need a tool for this job?
Claude Opus 5.5: 6.0, likely 5.0 to 7.0
Most Node web servers should send security headers, so a large group of backend developers needs this. Helmet is built for Express/Connect-style middleware, though NestJS and Fastify (via a wrapper) use it too. Front-end-only and Next.js/edge projects usually set headers some other way.
- helmet.js.org/faq/use-without-express: Helmet targets Express; ports exist for other frameworks
- github.com/fastify/fastify-helmet: Fastify's official plugin wraps Helmet
- docs.nestjs.com/security/helmet: NestJS documents Helmet for security headers
GPT-6.2 Sol: 5.8, likely 4.7 to 7.0
Security headers matter to many web teams, and Express still leads back-end framework usage among State of JavaScript respondents. Helmet covers the response-header part of the category and is designed for Node-style middleware. The survey measures framework use, so it gives only an indirect estimate of how many teams need Helmet itself.
- 2025.stateofjs.com/en-US/libraries/back-end-frameworks: Express leads reported back-end framework usage.
- helmet.js.org: Documents the Node and Express response-header middleware.
- docs.nestjs.com/security/helmet: NestJS 12.1 added its own header middleware with Helmet 8 defaults.
Helps a lot8.3
How well does it do the job for those who need it?
Claude Opus 5.5: 8.0, likely 7.0 to 9.0
It does its narrow job very well: safe defaults, an option for every header, dynamic CSP directives, typed options and clear errors for mistakes such as unquoted CSP keywords. There is little more a header library needs to do. It is held back by doing almost no checks on CSP quality and by its narrow scope within this category.
- github.com/helmetjs/helmet/blob/main/CHANGELOG.md: 8.2/8.3 add COOP values, faster CSP and better error handling
- unpkg.com/helmet@8.3.0/README.md: README: 13 headers by default, CSP checks are minimal
- npm hasTypes: Ships its own TypeScript types
GPT-6.2 Sol: 8.5, likely 7.4 to 9.5
Version 8.3.0 provides configurable defaults for CSP, HSTS, and cross-origin policies, and improves how CSP errors reach Express. Built-in types and short examples give coding agents a straightforward starting point. Custom policies still need app-specific review, and there is little independent evidence on performance or agent-written configurations.
- helmet.js.org: Documents per-header options, nonces, report-only mode, and limited CSP validation.
- github.com/helmetjs/helmet/blob/main/CHANGELOG.md: Version 8.3.0 improves CSP errors and routes dynamic directive failures through Express.
- github.com/PhBassin/allo-scrapper/issues/1156: A user reports a plain-HTTP development failure caused by the default HTTPS upgrade directive.
- npm hasTypes: The package ships its own TypeScript declarations.
Holds up over time7.3
Will it still be a good choice in two years?
Claude Opus 5.5: 7.0, likely 6.0 to 8.5
The project is active: 72 commits in the last year, npm releases in May and July 2026, and only 4 open issues. The scope is mostly finished, so the slow release pace is not a worry, and the 8.0 breaking changes were small. The main risk is that one maintainer carries most of the work.
- github commitsLastYear: 72 commits; pushed 2026-11-01
- npm versionsLastYear: 2 releases, latest 8.3.0 in July 2026
- scorecard Code-Review: 0, which suggests a single maintainer merges without review
- github openIssues: 4 open versus 347 closed
GPT-6.2 Sol: 7.6, likely 6.4 to 8.7
Helmet had 72 commits and two npm releases in the past year, with four open issues and one open pull request at the snapshot. The latest major upgrade changed HSTS defaults and tightened CSP input checks. Two npm collaborators are listed, but recent publishes came from one account, and the depth of funding and typical response times are unclear. NestJS now ships equivalent defaults, which reduces the need for Helmet in new Nest apps.
- github: 72 commits, four open issues, and one open pull request.
- npm versionsLastYear: Two npm releases in the past year.
- github.com/helmetjs/helmet/blob/main/CHANGELOG.md: Documents changes to HSTS and stricter CSP input handling in version 8.
- npmjs.com/package/helmet?activeTab=versions: Lists two package collaborators.
- socket.dev/npm/package/helmet/versions: Recent versions were published by the same account.
- github.com/sponsors/EvanHahn: Public sponsorship covers Helmet alongside other projects.
- docs.nestjs.com/security/helmet: NestJS offers equivalent defaults through a built-in API.
Used widely7.3
How many use it, and is that growing?
Claude Opus 5.5: 7.5, likely 6.5 to 8.5
About 92M downloads in 4 weeks and about 129k dependent repos make it very widely used. Some downloads come from @fastify/helmet and other packages that install it. Its year-over-year ratio of about 4.2 is right at the 4.1 median, so it is holding its share rather than gaining.
- npm downloadsLast4Weeks: 91.9M, up from 22.0M a year ago (ratio about 4.2, median 4.1)
- dependents repos: 128,887 repos, second only to cors and js-xss among peers
- github stars: 10.7k stars
GPT-6.2 Sol: 7.1, likely 6.0 to 8.2
Ecosyste.ms found about 129,000 dependent repositories, second only to cors among peers with a count. Four-week downloads rose from 22.0 million to 91.9 million, or 4.18 times, just above the 4.1 catalog median and behind cors, express-rate-limit, and DOMPurify. That suggests only a small relative gain. The download count includes automated and indirect installs, and the collector found no recent Bluesky links or matched Hacker News stories to clarify the trend.
- dependents: Ecosyste.ms found 128,887 repositories and 3,069 packages.
- npm downloadsLast4Weeks and downloadsSame4WeeksYearAgo: 91.9 million versus 22.0 million downloads.
- medianDownloadsRatio: The catalog median is 4.1, close to Helmet’s 4.18.
- peers: Helmet ranks second in measured dependent repositories, while several large peers grew faster.
- github stars: 10,749 stars indicate substantial accumulated attention.
- bluesky and hackerNews: No posts or matched stories in the supplied counts.
Vouched for7.8
Who stands behind it being good?
Claude Opus 5.5: 7.5, likely 6.5 to 8.5
The Express project's own security best-practice guide recommends it, NestJS documents it, and the Fastify team maintains a plugin that wraps it. Tutorials from 2026 still treat it as the standard. There is no survey data or independent benchmark, and it gets almost no social attention.
- expressjs.com/en/advanced/best-practice-security.html: The official Express security guide recommends Helmet
- docs.nestjs.com/security/helmet: NestJS security docs use Helmet
- oneuptime.com/blog/post/2026-01-25-helmet-security-expressjs/view: 2026 independent tutorial treats it as the standard
- bluesky posts: 0 posts, little social attention
GPT-6.2 Sol: 8.0, likely 6.9 to 9.0
Express recommends Helmet for production, Backstage integrates it into its backend router, and MDN demonstrates how to configure it for a deployed app. OWASP also lists it in its Secure Headers Project resources. Available independent testing covers Helmet as part of broader hardening, so its individual impact and developer satisfaction are less precisely measured.
- expressjs.com/en/advanced/best-practice-security: Express recommends Helmet in its production security guide.
- github.com/backstage/backstage/blob/master/docs/backend-system/core-services/root-http-router.md: Backstage exposes Helmet as built-in root router middleware.
- developer.mozilla.org/en-US/docs/Learn_web_development/Extensions/Server-side/Express_Nodejs/deployment: MDN demonstrates Helmet in an Express deployment and shows where defaults need tuning.
- secure-headers-project.owasp.org/technical-resources: OWASP lists Helmet as a Node.js secure-header tool.
- theseus.fi/bitstream/handle/10024/915394/Paragahathannalage_Sanjeewa.pdf?isAllowed=y&sequence=2: An independent Express case study verified Helmet headers as part of a broader hardening exercise.
Safe8.5
How safe is it to depend on?
Claude Opus 5.5: 8.5, likely 7.5 to 9.5
It has no dependencies, no advisories ever, an MIT licence and a Scorecard of 7.1 with pinned dependencies, SAST and a security policy. Its weak checks are code review, fuzzing and CII best practices. Releases depend on a small number of publishers.
- npm dependencies: 0 dependencies
- advisories total: 0 advisories
- scorecard score: 7.1; Code-Review, Fuzzing and CII are 0
- npm license: MIT
GPT-6.2 Sol: 8.5, likely 7.3 to 9.4
The package has a permissive MIT licence, zero runtime dependencies, and no known advisories in the sources checked. OpenSSF Scorecard gives it 7.1, with strong workflow permissions and a security policy, but zero scores for code review and fuzzing. Recent npm releases came from one account, and the available checks leave release signing and the publishing process unclear.
- npm dependencies and license: Zero runtime dependencies and an MIT licence.
- advisories: The OSV snapshot lists zero advisories.
- scorecard checks: Code Review and Fuzzing scored zero. Packaging and Signed Releases were unscored.
- socket.dev/npm/package/helmet/versions: The same account published the recent versions.
Good
- One `app.use(helmet())` call sets about 13 safe headers, and each one can be configured or turned off.
- It has no dependencies, ships its own TypeScript types and has no security advisories on record.
- The Express docs recommend it, NestJS documents it, and the official Fastify plugin is built on it.
- 8.x releases tighten CSP checking and give clearer error messages without breaking existing code.
Bad
- It only sets headers. You still need separate libraries for rate limiting, CORS, CSRF and HTML sanitizing.
- Next.js, Hono and edge runtimes set headers in their own ways, so Helmet is mostly useful on Express-style servers.
- One maintainer does most of the work, and changes get no second reviewer (Scorecard Code-Review is 0).
- It does little to check that your CSP is correct, so a weak policy can pass without warning.
The numbers
- npm downloads, 4 weeks
- 92M ×4.2 in a year
- GitHub stars
- 11k
- Commits, 12 months
- 72
- npm version
- 8.3.0 Jul 2026
- Versions, 12 months
- 2
- Advisories, 24 months
- 0 of 0 ever
- OpenSSF Scorecard
- 7.1 out of 10, Nov 2026
- Licence
- MIT
Read on 21 November 2026 from GitHub (helmetjs/helmet), npm (helmet), OSV and the OpenSSF Scorecard.
Web security libraries
- 8.7DOMPurify
- 8.2Helmet
- 7.9express-rate-limit
- 7.6cors
- 7.4rate-limiter-flexible
- 7.0Upstash Ratelimit
- 6.8sanitize-html
- 6.1csrf-csrf
- 5.7Arcjet
- 5.0js-xss