Socket
Socket
Sign inDemoInstall

handlebars-helper-sri

Package Overview
Dependencies
2
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    handlebars-helper-sri

Sub-resource integrity in Handlebars


Version published
Maintainers
1
Install size
290 kB
Created

Readme

Source

handlebars-helper-sri Build Status

Install

npm install --save handlebars-helper-sri

Usage

Attach the helper to handlebars:

var handlebars = require("handlebars");

handlebars = require("handlebars-helper-sri").register(handlebars);

Then, call the helper from your Handlebars template:

<script src="/script.js" integrity="{{sri "./public/script.js"}}"></script>
<link href="/style.css" integrity="{{sri "./public/style.css"}}" rel="stylesheet">

Caching

You may wish to attach a custom subresource instance, for pre-load caching:

var handlebars = require("handlebars");
var subresource = require("subresource");

[
    "../public/script.js",
    "../public/style.css"
].forEach(subresource);

handlebars = require("handlebars-helper-sri").register(handlebars, subresource);

Keywords

FAQs

Last updated on 02 Mar 2015

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