handlebars-helper-sri

0.0.0 • Public • Published

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);

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.0
    3
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.0
    3

Package Sidebar

Install

npm i handlebars-helper-sri

Weekly Downloads

3

Version

0.0.0

License

none

Last publish

Collaborators

  • neftaly