Socket
Socket
Sign inDemoInstall

micro-helmet

Package Overview
Dependencies
1
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    micro-helmet

security headers for micro


Version published
Weekly downloads
49
decreased by-18.33%
Maintainers
1
Install size
79.3 kB
Created
Weekly downloads
 

Changelog

Source

2.0.0

  • Upgrade to helmet v4, now requires Node.js 10+.

Readme

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

Last updated on 07 Aug 2020

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc