srify
Adds computed integrity
attributes to same domain external script and stylesheet tags on html markup.
Install
npm install srify
Usage
CLI
srify build/index.html
srify --help
Node.js
const srify = const markup = ` <html> <head> <link rel="stylesheet" href="/style.css" /> <link rel="stylesheet" href="https://some.cdn/style.css" /> <script src="https://some.cdn/script.js"></script> </head> <body> <script src="/script.js"></script> </body> </html>`const markupSrified = console
output:
Test
npm test
Change log
2.0.3
: fix<noscript>
regex2.0.2
: properly handle<link>
tags inside<noscript>
(removed)2.0.1
: xxxxxxxx xxxxxx xxxx xxxxxx2.0.0
: add CLI command, change options defaults1.0.1
: fix main entry inpackage.json
1.0.0
: initial release