@dintero/sri-to-dist

中文文档
1.1.22发布于 2026/11/04MITTypeScriptCommonJS零依赖构建来源已验证近 30 天下载 2453

HTML tool for adding subresource integrity hashes

原始使用文档
文档目录8 节
  1. Installation
  2. Usage
  3. Options
  4. License
  5. Security
  6. Step 8: Build and test locally
  7. Step 9: Publish to npm
  8. Creating a new release

sri-to-dist

Actions StatusActions Statusnpm latest version

A tool to add subresource integrity (SRI) hashes to HTML files.

Installation

npm install -g @dintero/sri-to-dist
# or
npx @dintero/sri-to-dist

Usage

sri-to-dist -i input.html -o output.html
sri-to-dist --input input.html --output output.html --base-url https://example.com

Options

  • -i, --input <file>: Input HTML file (required)
  • -o, --output <file>: Output HTML file (optional, defaults to stdout)
  • -b, --base-url <url>: Base URL for resolving relative paths (optional)
  • -n, --no-remote <url>: Optional flag, no remote sri files allowed
  • -v, --verify <url>: Optional flag, verify that all sri resources from input have correct sha384 hashes

License

MIT

Security

Contact us at [email protected]

Step 8: Build and test locally

npm install
npm run build
npm run test
npm link  # This makes your package available globally for testing

Now you can run:

sri-to-dist -i test.html

Step 9: Publish to npm

npm login
npm publish

Creating a new release

  1. Enforce all commits to the master branch to be formatted according to the Angular Commit Message Format
  2. When merged to master, it will automatically be released with semantic-release

版本与发布记录

@dintero/sri-to-dist 共发布 33 个版本,首次发布于 2025/04/07;过去 12 个月发布了 20 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
1.1.22latest2026/11/049 天前
1.1.212026/10/131 个月前
1.1.202026/10/091 个月前
1.1.192026/10/091 个月前
1.1.182026/09/301 个月前
1.1.172026/09/291 个月前

关于 @dintero/sri-to-dist 的常见问题

@dintero/sri-to-dist 是什么?

HTML tool for adding subresource integrity hashes

如何安装 @dintero/sri-to-dist?

在项目目录运行 npm install @dintero/sri-to-dist,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 sri-to-dist,可以用 npx sri-to-dist 直接运行。

@dintero/sri-to-dist 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@dintero/sri-to-dist 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@dintero/sri-to-dist 可以商用吗?

@dintero/sri-to-dist 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@dintero/sri-to-dist 的下载量有多少?

根据 npm 官方下载统计,@dintero/sri-to-dist 在 2026/10/13 – 2026/11/11 这 30 天内被下载 2,453 次,日均约 82 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@dintero/sri-to-dist 还在维护吗?

最新版本 1.1.22 发布于 2026/11/04(9 天前);至今共发布 33 个版本,其中过去 12 个月发布了 20 个;首次发布于 2025/04/07。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。