Socket
Socket
Sign inDemoInstall

handlebars-csp-hash

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

handlebars-csp-hash

Handlebars helper for generating Content-Security-Policy hash values


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

What is this?

This is a simple handlebars helper which will generate a Content-Security-Policy hash for an inline script or style, which you can drop into the header of your web page.

Usage

npm install handlebars-csp-hash

In your handlebars template:

<meta
    http-equiv="Content-Security-Policy"
    content="default-src 'self'; style-src 'self' '{{{ csp-hash "build/inline.css" }}}' 'unsafe-inline'"
    >

Options

By default it will generate a SHA256, but you can also use SHA384 or SHA512

{{ csp-hash "build/inline.css" "sha384" }}

Keywords

FAQs

Package last updated on 03 Oct 2019

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