针锋相对
一个将子资源完整性(SRI)散列添加到 HTML 文件的工具.
安装
npm install -g @dintero/sri-to-dist
# or
npx @dintero/sri-to-dist
使用量
sri-to-dist -i input.html -o output.html
sri-to-dist --input input.html --output output.html --base-url https://example.com
选项
-i, --input <file>: 输入 HTML 文件(需要)-o, --output <file>: 输出 HTML 文件( 可选的, 默认为 stdout)-b, --base-url <url>: 用于解析相对路径的基础 URL (可选)-n, --no-remote <url>: 可选旗帜, 不允许远程 sri 文件-v, --verify <url>: 可选旗帜, 验证输入的所有 sri 资源是否正确 sha384 hashes
许可证
麻省理工学院
警卫
联系我们 安全性@dintero.com
第8步:在当地建立和测试
npm install
npm run build
npm run test
npm link # This makes your package available globally for testing
现在你可以跑:
sri-to-dist -i test.html
第9步:发布到npm
npm login
npm publish