# @blitz-guard/core 中文文档

规范地址：https://npmcn.com/package/%40blitz-guard/core/

版本：0\.4\.1
npm 元数据更新时间：2022-04-04T19:35:14.575Z
中文译文更新时间：2026-11-08T06:56:48.532Z
软件包许可：MIT

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40blitz-guard/core
原文对照：https://npmcn.com/package/%40blitz-guard/core/?lang=original
项目主页：https://github.com/ntgussoni/blitz-guard#readme
源码仓库：https://github.com/ntgussoni/blitz-guard

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：35.2 kB，9 个文件
- 模块格式：ESM + CJS
- TypeScript 类型：包内自带
- 运行依赖：2 个
- peer 依赖：blitz ^0\.38\.6
- 首次发布：2021-01-23T09:52:28.842Z
- 最新版本发布：2021-07-29T18:15:07.922Z
- 近 30 天下载量：3652（2026-10-09 至 2026-11-07，npm 官方下载统计）
- 已发布版本数：11（近 12 个月 0 个）

## 中文简介

Blitz.js 的授权

## 安装

```sh
npm install @blitz-guard/core
```

也可以使用：`pnpm add @blitz-guard/core`、`yarn add @blitz-guard/core`、`bun add @blitz-guard/core`

## README

![](https://npmcn.com/package/%40blitz-guard/core/blitz-guard.png)

> Blitz.js的集中许可授权

![GitHub Workflow Status (branch)](https://img.shields.io/github/workflow/status/ntgussoni/blitz-guard/Continuous%20Integration/main?style=for-the-badge) ![npm](https://img.shields.io/npm/v/@blitz-guard/core?style=for-the-badge) ![npm](https://img.shields.io/npm/dm/@blitz-guard/core?style=for-the-badge)

Blitz Guard是一个允许或限制特定资源访问的授权库. 执行 [基于属性的访问控制](https://en.wikipedia.org/wiki/Attribute-based_access_control)

它旨在减少锅炉板 并难以理解授权规则 通过只有一个来源的真相 [能力文件](https://ntgussoni.github.io/blitz-guard/docs/ability-file)

# 安装

使用食谱是最简单的方法. 它会添加软件包并创建基础配置文件.

`blitz install ntgussoni/blitz-guard-recipe`

# 开始吧

[见文件](https://ntgussoni.github.io/blitz-guard/docs/)

# 如何捐款

[看看如何在这里贡献](https://ntgussoni.github.io/blitz-guard/docs/contributing)

## 贡献者

**谢谢你造了这个很棒的图书馆.**

<table><tbody><tr><td align="center"><a href="https://github.com/cherta" rel="nofollow noopener noreferrer"><img alt="" src="https://avatars2.githubusercontent.com/u/373454?v=4?s=80" width="80px;" loading="lazy" decoding="async" referrerpolicy="no-referrer"><br><sub><b>加布里埃尔·切尔托克</b></sub></a><br><a href="https://github.com/ntgussoni/blitz-guard/commits?author=cherta" title="Code" rel="nofollow noopener noreferrer">💻</a> <a href="https://github.com/ntgussoni/blitz-guard/issues?q=author%3Acherta" title="Bug reports" rel="nofollow noopener noreferrer">🐛</a> <a href="https://github.com/ntgussoni/blitz-guard/commits?author=cherta" title="Documentation" rel="nofollow noopener noreferrer">📖</a></td><td align="center"><a href="https://github.com/ntgussoni" rel="nofollow noopener noreferrer"><img alt="" src="https://avatars0.githubusercontent.com/u/10161067?v=4?s=80" width="80px;" loading="lazy" decoding="async" referrerpolicy="no-referrer"><br><sub><b>尼古拉·托雷斯(签名)</b></sub></a><br><a href="https://github.com/ntgussoni/blitz-guard/commits?author=ntgussoni" title="Code" rel="nofollow noopener noreferrer">💻</a> <a href="https://github.com/ntgussoni/blitz-guard/issues?q=author%3Antgussoni" title="Bug reports" rel="nofollow noopener noreferrer">🐛</a> <a href="https://github.com/ntgussoni/blitz-guard/commits?author=ntgussoni" title="Documentation" rel="nofollow noopener noreferrer">📖</a></td><td align="center"><a href="https://github.com/Fralez" rel="nofollow noopener noreferrer"><img alt="" src="https://avatars.githubusercontent.com/u/40028772?v=4?s=80" width="80px;" loading="lazy" decoding="async" referrerpolicy="no-referrer"><br><sub><b>佛朗哥·冈萨雷斯</b></sub></a><br><a href="https://github.com/ntgussoni/blitz-guard/commits?author=Fralez" title="Documentation" rel="nofollow noopener noreferrer">📖</a></td><td align="center"><a href="https://learningman.top/" rel="nofollow noopener noreferrer"><img alt="" src="https://avatars.githubusercontent.com/u/31370133?v=4?s=80" width="80px;" loading="lazy" decoding="async" referrerpolicy="no-referrer"><br><sub><b>兹克莉</b></sub></a><br><a href="https://github.com/ntgussoni/blitz-guard/issues?q=author%3AZxilly" title="Bug reports" rel="nofollow noopener noreferrer">🐛</a></td><td align="center"><a href="https://oesterkilde.dk/" rel="nofollow noopener noreferrer"><img alt="" src="https://avatars.githubusercontent.com/u/6379824?v=4?s=80" width="80px;" loading="lazy" decoding="async" referrerpolicy="no-referrer"><br><sub><b>凯文·奥斯特基尔德</b></sub></a><br><a href="https://github.com/ntgussoni/blitz-guard/commits?author=Kosai106" title="Documentation" rel="nofollow noopener noreferrer">📖</a></td><td align="center"><a href="https://github.com/frankiesardo" rel="nofollow noopener noreferrer"><img alt="" src="https://avatars.githubusercontent.com/u/1476561?v=4?s=80" width="80px;" loading="lazy" decoding="async" referrerpolicy="no-referrer"><br><sub><b>弗朗切斯科·萨尔多</b></sub></a><br><a href="https://github.com/ntgussoni/blitz-guard/commits?author=frankiesardo" title="Code" rel="nofollow noopener noreferrer">💻</a> <a href="https://github.com/ntgussoni/blitz-guard/issues?q=author%3Afrankiesardo" title="Bug reports" rel="nofollow noopener noreferrer">🐛</a></td><td align="center"><a href="https://github.com/bravo-kernel" rel="nofollow noopener noreferrer"><img alt="" src="https://avatars.githubusercontent.com/u/230500?v=4?s=80" width="80px;" loading="lazy" decoding="async" referrerpolicy="no-referrer"><br><sub><b>bravo 内核</b></sub></a><br><a href="https://github.com/ntgussoni/blitz-guard/commits?author=bravo-kernel" title="Documentation" rel="nofollow noopener noreferrer">📖</a></td></tr></tbody></table>

## 常见问题

### @blitz-guard/core 是什么？

Blitz\.js 的授权

### 如何安装 @blitz-guard/core？

在项目目录运行 npm install @blitz-guard/core，或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖：blitz（^0\.38\.6）。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖，Yarn 需要手动安装。

### @blitz-guard/core 支持 TypeScript 吗？

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

### @blitz-guard/core 支持 ESM 还是 CommonJS？

同时提供 ES Module 与 CommonJS 入口，import 和 require\(\) 都可以使用，打包工具会自动选择合适的版本。

### @blitz-guard/core 可以商用吗？

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

### @blitz-guard/core 的下载量有多少？

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

### @blitz-guard/core 还在维护吗？

最新版本 0\.4\.1 发布于 2021/07/30（5 年前）；至今共发布 11 个版本，其中过去 12 个月发布了 0 个；首次发布于 2021/01/23。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

