0.0.0 • Published 11 years ago
handlebars-helper-sri v0.0.0
handlebars-helper-sri 
Install
npm install --save handlebars-helper-sriUsage
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);0.0.0
11 years ago