# @bifravst/cloudformation-helpers 中文文档

规范地址：https://npmcn.com/package/%40bifravst/cloudformation-helpers/

版本：10\.0\.3
npm 元数据更新时间：2026-10-31T01:13:11.098Z
中文译文更新时间：2026-11-08T01:46:07.515Z
软件包许可：BSD-3-Clause

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

原始 npm 页面：https://www.npmjs.com/package/%40bifravst/cloudformation-helpers
原文对照：https://npmcn.com/package/%40bifravst/cloudformation-helpers/?lang=original
项目主页：https://github.com/bifravst/cloudformation-helpers
源码仓库：https://github.com/bifravst/cloudformation-helpers

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

- 包体积（解压后）：13.4 kB，15 个文件
- 模块格式：ES Module
- TypeScript 类型：包内自带
- Node.js 要求：\>=24\.22\.1 \<25 \|\| \>=26\.12\.1 \<27
- 运行依赖：1 个
- peer 依赖：@aws-sdk/client-cloudformation \>= 3 \< 4
- 首次发布：2020-05-04T11:09:09.206Z
- 最新版本发布：2026-10-31T01:13:10.712Z
- 近 30 天下载量：6136（2026-10-08 至 2026-11-06，npm 官方下载统计）
- 已发布版本数：139（近 12 个月 4 个）

## 中文简介

简化 AWS CloudFormation 堆栈工作的辅助功能

## 安装

```sh
npm install @bifravst/cloudformation-helpers
```

也可以使用：`pnpm add @bifravst/cloudformation-helpers`、`yarn add @bifravst/cloudformation-helpers`、`bun add @bifravst/cloudformation-helpers`

## README

# 云阵帮助 [![npm version](https://img.shields.io/npm/v/@bifravst/cloudformation-helpers.svg)](https://www.npmjs.com/package/@bifravst/cloudformation-helpers)

[![GitHub Actions](https://github.com/bifravst/cloudformation-helpers/workflows/Test%20and%20Release/badge.svg)](https://github.com/bifravst/cloudformation-helpers/actions) [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release) [![Renovate](https://img.shields.io/badge/renovate-enabled-brightgreen.svg)](https://renovatebot.com/) [![@commitlint/config-conventional](https://img.shields.io/badge/%40commitlint-config--conventional-brightgreen)](https://github.com/conventional-changelog/commitlint/tree/master/@commitlint/config-conventional) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier/) [![ESLint: TypeScript](https://img.shields.io/badge/ESLint-TypeScript-blue.svg)](https://github.com/typescript-eslint/typescript-eslint)

用于简化 AWS CloudFormation 堆栈工作的辅助函数.

## 安装

```
npm i --save-dev --save-exact @bifravst/cloudformation-helpers
```

## 使用量

### `cfnResponse`

`cfnResponse` 执行自定义资源响应.

```typescript
import { cfnResponse, ResponseStatus } from "@bifravst/cloudformation-helpers";
import { CloudFormationCustomResourceEvent } from "aws-lambda";

/**
 * Lambda creating a custom resource
 */
export const handler = async (
  event: CloudFormationCustomResourceEvent,
): Promise<void> => {
  // Create custom resource ...

  await cfnResponse({
    Status: ResponseStatus.SUCCESS,
    event,
    PhysicalResourceId: "MyCustomResource",
  });
};
```

## 节点和国家预防机制

这个项目需要节点.js `>=24.22.1 <25 || >=26.12.1 <27` 页:1 `>=12.0.2 <13` (通过 `check-node-version` 打开 `npm install` 财务报告和审定财务报表 `npm ci`) (中文(简体) ).

检查时跳过 `npm publish` 财务报告和审定财务报表 `npm pack`,因为 `semantic-release` 捆绑自己的npm(`@semantic-release/npm` 取决于 `npm@^11.6.2`)并使用该版本而不是该版本运行出版物 安装于 CI.

## 类型脚本 6和 7

此还原 [并行运行类型脚本 6和 7](https://devblogs.microsoft.com/typescript/announcing-typescript-7-0/#running-side-by-side-with-typescript-6.0), (中文(简体) ), [这样,斯林特工作](https://github.com/typescript-eslint/typescript-eslint/issues/10940#issuecomment-4922812181)。 。 。 .

## 常见问题

### @bifravst/cloudformation-helpers 是什么？

简化 AWS CloudFormation 堆栈工作的辅助功能

### 如何安装 @bifravst/cloudformation-helpers？

在项目目录运行 npm install @bifravst/cloudformation-helpers，或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖：@aws-sdk/client-cloudformation（\>= 3 \< 4）。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖，Yarn 需要手动安装。

### @bifravst/cloudformation-helpers 支持 TypeScript 吗？

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

### @bifravst/cloudformation-helpers 支持 ESM 还是 CommonJS？

以 ES Module 形式发布，推荐使用 import 引入。在 CommonJS 项目中，Node\.js 20\.19\+ / 22\.12\+ 可以直接 require\(\) 不含顶层 await 的 ES Module，更早的版本需要改用动态 import\(\)。

### @bifravst/cloudformation-helpers 需要什么版本的 Node\.js？

package\.json 的 engines 字段要求 Node\.js \>=24\.22\.1 \<25 \|\| \>=26\.12\.1 \<27。版本不符时 npm 默认只给出警告，开启 engine-strict 后会拒绝安装。

### @bifravst/cloudformation-helpers 可以商用吗？

@bifravst/cloudformation-helpers 使用 BSD-3-Clause 许可。宽松许可：允许商业使用、修改和再分发，通常只需在分发时保留原版权与许可声明。另外不得用原作者名义为衍生产品背书。以上为概括，不构成法律意见，请以许可原文为准。

### @bifravst/cloudformation-helpers 的下载量有多少？

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

### @bifravst/cloudformation-helpers 还在维护吗？

最新版本 10\.0\.3 发布于 2026/10/31（8 天前）；至今共发布 139 个版本，其中过去 12 个月发布了 4 个；首次发布于 2020/05/04。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

