# @castore/core 中文文档

规范地址：https://npmcn.com/package/%40castore/core/

版本：2\.4\.2
npm 元数据更新时间：2025-04-18T15:44:44.764Z
中文译文更新时间：2026-11-09T05:04:21.104Z
软件包许可：MIT

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

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

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

- 包体积（解压后）：548 kB，311 个文件
- 模块格式：ESM + CJS
- TypeScript 类型：包内自带
- 运行依赖：2 个
- 首次发布：2022-07-08T17:17:30.755Z
- 最新版本发布：2025-04-18T15:44:44.559Z
- 近 30 天下载量：10252（2026-10-09 至 2026-11-07，npm 官方下载统计）
- 已发布版本数：65（近 12 个月 0 个）

## 中文简介

![](https://npmcn.com/package/%40castore/core/assets/logo.svg)

# 卡斯托尔

## 安装

```sh
npm install @castore/core
```

也可以使用：`pnpm add @castore/core`、`yarn add @castore/core`、`bun add @castore/core`

## README

![](https://npmcn.com/package/%40castore/core/assets/logo.svg)

# 卡斯托尔

 [![](https://img.shields.io/npm/v/@castore/core?color=935e0e&style=for-the-badge)](https://www.npmjs.com/package/@castore/core)[![](https://img.shields.io/github/license/castore-dev/castore?color=%23F8A11C&style=for-the-badge) ](https://github.com/castore-dev/castore/blob/main/LICENSE)![](https://img.shields.io/npm/dt/@castore/core?color=%23B7612E&style=for-the-badge)  
  

💖 _非常感谢 [提案国](https://github.com/sponsors/ThomasAribart) 帮助我保持这个回扣:_

[![Theodo](https://github.com/theodo.png "Theodo")](https://www.theodo.fr/)   [![feathers.dev](https://github.com/feathersdev.png "feathers.dev")](https://github.com/feathersdev)  [![lijianan](https://github.com/li-jia-nan.png "lijianan")](https://github.com/li-jia-nan)  [![Raees Iqbal](https://github.com/RaeesBhatti.png "Raees Iqbal")](https://github.com/RaeesBhatti)  [![Lucas Saldanha Ferreira](https://github.com/lucas-subli.png "Lucas Saldanha Ferreira")](https://github.com/lucas-subli)  [![Syntax](https://github.com/syntaxfm.png "Syntax")](https://github.com/syntaxfm)   [![Plus sign](https://npmcn.com/package/%40castore/core/assets/plus-sign.png "Your brand here!")](https://github.com/sponsors/ThomasAribart)

# 让事件变得容易

[事件判定](https://learn.microsoft.com/en-us/azure/architecture/patterns/event-sourcing) 是保存数据存储范式 **应用程序状态的变化** 而不是国家本身.

它的威力是强大的 **正在倒向上一个状态** 财务报告和审定财务报表 **探索审计线索** 用于调试或商业/法律目的。 也很好地融入了 [事件驱动架构](https://en.wikipedia.org/wiki/Event-driven_architecture)。 。 。 .

然而,这是 **难以执行** 😅

经过多年的使用 [西奥多](https://dev.to/slsbytheodo)我们越来越喜欢它,但也亲身体验到缺乏共识和工具。 卡斯托尔就是从那里来的!

* * *

Castore 是一个类型脚本库 **让事件变得容易** 😎

* * *

## 特征

**堆叠不可知论**: 可以在任何JS语境中被使用(网络应用,容器,羊肉. 你把它命名为QQ)

**轻型**数字 : _选入_ 仅包

**\* 类型安全** 推到极限

**校验库不可知论** (单位:千美元)[佐德语Name](https://github.com/colinhacks/zod), (中文(简体) ), [JSON 计划](https://github.com/ThomasAribart/json-schema-to-ts)支持类型推论

**· 现成适配器** 页:1 [复数](https://redux.js.org/), (中文(简体) ), [迪纳摩DB](https://aws.amazon.com/dynamodb/), (中文(简体) ), [质量](https://aws.amazon.com/sqs/), (中文(简体) ), [事件桥](https://aws.amazon.com/eventbridge/) 更多

**测试工具** 包含

**迁移和维护工具** 可用

**QQ 反应组件** 可视化和模拟您的活动商店

还有更多要来: 管理者、快照、阅读模型...

## 拜访一下.. [正式文件](https://castore-dev.github.io/castore/) 开始吧!

### [成为赞助人!](https://github.com/sponsors/thomasaribart/)

## 常见问题

### @castore/core 是什么？

卡斯托尔

### 如何安装 @castore/core？

在项目目录运行 npm install @castore/core，或使用 pnpm add / yarn add / bun add。

### @castore/core 支持 TypeScript 吗？

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

### @castore/core 支持 ESM 还是 CommonJS？

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

### @castore/core 可以商用吗？

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

### @castore/core 的下载量有多少？

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

### @castore/core 还在维护吗？

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

