Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

micro-helmet

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

micro-helmet

security headers for micro

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
28
decreased by-46.15%
Maintainers
1
Weekly downloads
 
Created
Source

micro-helmet

security headers for micro using helmet

requires node.js 10+

Install - Usage - License: Apache-2.0

npm travis standard

Install

npm install micro-helmet

Usage

As a wrapper function:

var helmet = require('micro-helmet')

module.exports = helmet(async (req, res) => {
  return { ok: true }
})

As a utility:

var helmet = require('micro-helmet')

module.exports = async (req, res) => {
  await helmet.addHeaders(req, res)
  return { ok: true }
}

API

helmet(handler, opts={})

Wrap a handler function. This adds helmet's headers before calling your handler. opts can be used to configure specific headers. It is passed through to helmet.

await helmet.addHeaders(req, res, opts={})

Add helmet's headers. opts can be used to configure specific headers. It is passed through to helmet.

License

Apache-2.0

Keywords

FAQs

Package last updated on 07 Aug 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc