Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on Apr 10, 2024 via pnpm

helmet 7.0.0

help secure Express/Connect apps with various HTTP headers
Package summary
Share
0
issues
1
license
1
MIT
Package created
2 Feb 2012
Version published
6 May 2023
Maintainers
2
Total deps
1
Direct deps
0
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
helmet@7.0.0
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

0
All Dependencies CSV
β“˜ This is a list of helmet 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does helmet do?

Helmet is a key security module for Node.js applications. It works by setting various HTTP response headers to help protect your Express apps from potential security threats. Features like mitigating cross-site scripting (XSS) attacks, preventing clickjacking, and enforcing secure (HTTPs-only) connections, among others, are part of Helmet's functionality. It's like a protective helmet for your Express-based web applications enhancing security and guarding against several common web vulnerabilities.

How do you use helmet?

Utilizing Helmet in your Express application is quite straightforward. Install it via npm with the command npm install helmet and integrate it into your Express application as middleware like this:

import express from "express";
import helmet from "helmet";

const app = express();

// Enable Helmet
app.use(helmet());

app.get("/", (req, res) => {
  res.send("Secured Hello world!");
});

app.listen(8000);

You can also customize which headers Helmet sets and tweak their configurations. For example, you can configure the Content-Security-Policy header followingly:

app.use(
  helmet({
    contentSecurityPolicy: {
      directives: {
        "script-src": ["'self'", "example.com"],
      },
    },
  })
);

Or, you can disable some headers like this:

app.use(
  helmet({
    contentSecurityPolicy: false,
    xDownloadOptions: false,
  })
);

Where are the helmet docs?

The complete helmet documentation can be found within the codebase on its GitHub repository at git://github.com/helmetjs/helmet.git. Here, you will find in-depth details about each header set by Helmet, their defaults, customization options, how to enable or disable individual headers, links to relevant external resources, and some FAQ. The readme in the GitHub repository serves as the primary point of documentation.