Effect-TS / effect

Effect-TS / effect

Effect is a library for building robust, maintainable, type-safe, and production-grade applications in TypeScript. It helps you handle the hard problems at scale: typed errors, dependency injection, structured concurrency, scheduling, tracing, and unified schema validation. Effect 4.x is a long-term support (LTS) release. If you are upgrading from Effect 3.x, follow the migration guide.

Effect 是一个用于在 TypeScript 中构建健壮、可维护、类型安全且生产级应用程序的库。它能帮助你处理大规模应用中的难题:类型化错误、依赖注入、结构化并发、调度、追踪以及统一的模式验证。Effect 4.x 是一个长期支持(LTS)版本。如果你是从 Effect 3.x 升级,请参考迁移指南。

Installation

npm install effect

安装

npm install effect

Requirements

TypeScript 5.9 or newer. TypeScript 7 is recommended for the best performance and compatibility with Effect’s TypeScript tooling. Node.js 18 or newer is the general minimum for running Effect on Node.js. Some integration packages require newer runtimes; for example, @effect/sql-sqlite-node requires Node.js 22.16 or newer. Strict type-checking: the strict flag must be enabled in your tsconfig.json.

要求

TypeScript 5.9 或更高版本。建议使用 TypeScript 7 以获得最佳性能以及与 Effect TypeScript 工具链的兼容性。在 Node.js 上运行 Effect,通常最低要求为 Node.js 18。部分集成包需要更新的运行时;例如,@effect/sql-sqlite-node 需要 Node.js 22.16 或更高版本。严格类型检查:必须在 tsconfig.json 中启用 strict 标志。

  • Website: documentation, guides, and news
  • Discord: ask questions, share what you’re building, and talk to the core team
  • Community: meetups and events, or bring Effect to your own
  • Issues: bug reports and feature requests
  • Jobs: companies hiring Effect developers
  • Follow us on X, Bluesky, and LinkedIn

链接

  • 网站:文档、指南和新闻
  • Discord:提问、分享你的项目并与核心团队交流
  • 社区:聚会和活动,或将 Effect 带到你自己的社区
  • Issues:错误报告和功能请求
  • 招聘:正在招聘 Effect 开发者的公司
  • 在 X、Bluesky 和 LinkedIn 上关注我们

Let’s talk

Whether your team is considering Effect, rolling it out, or already running it in production, we’d love to hear from you: what you’re building, what works, and what you need from Effect next. Talk to the maintainers. Introduce your team on Discord or email contact@effectful.co. We’re happy to connect privately on Slack or Discord for feedback and help with adoption.

交流与反馈

无论你的团队是在考虑使用 Effect、正在部署,还是已经在生产环境中使用,我们都非常期待听到你的声音:你正在构建什么、哪些功能好用,以及你接下来对 Effect 有什么需求。请与维护者交流。你可以在 Discord 上介绍你的团队,或发送邮件至 contact@effectful.co。我们很乐意通过 Slack 或 Discord 进行私下沟通,以获取反馈并协助你采用该技术。

Production support

We’re exploring how to better support teams running Effect in production. If your organization has specific support needs, let’s discuss them.

生产环境支持

我们正在探索如何更好地支持在生产环境中使用 Effect 的团队。如果你的组织有特定的支持需求,欢迎与我们讨论。

Adoption help

Our adoption partners offer implementation, consulting, team extension, training, and commercial support. Feedback from teams using and evaluating Effect directly shapes what we stabilize and build next.

采用协助

我们的采用合作伙伴提供实施、咨询、团队扩展、培训和商业支持。来自使用和评估 Effect 的团队的反馈,直接决定了我们接下来要稳定和构建的内容。

Long-term support

Teams depend on Effect for systems they expect to run for years. Effect 4.x is a long-term support (LTS) release with the following guarantees:

  • At least three years of support, including bug and security fixes.
  • Bug fixes for one year after the next major version is released.
  • Security fixes for two years after the next major version is released.
  • Stable APIs reserve breaking changes for major releases. APIs marked unstable may change in minor releases, and experimental APIs may change in patch releases.

长期支持

许多团队依赖 Effect 来构建预期运行多年的系统。Effect 4.x 是一个长期支持(LTS)版本,并提供以下保证:

  • 至少三年的支持,包括错误修复和安全补丁。
  • 下一个主要版本发布后,继续提供一年的错误修复。
  • 下一个主要版本发布后,继续提供两年的安全修复。
  • 稳定版 API 的破坏性变更仅限于主要版本。标记为不稳定的 API 可能会在次要版本中更改,而实验性 API 可能会在补丁版本中更改。

Effect v3

The Effect v3 source code is available on the v3 branch, which is also where issues and pull requests meant for Effect v3 should be targeted. To upgrade, see the migration guide.

Effect v3

Effect v3 的源代码可在 v3 分支获取,针对 Effect v3 的 Issue 和 Pull Request 也应提交至该分支。如需升级,请参阅迁移指南。

Packages

This monorepo contains the core effect package alongside integration packages that extend it. All packages listed below are released together with synchronized versions.

软件包

此 Monorepo 包含核心 effect 软件包以及扩展它的集成包。下方列出的所有软件包均同步发布版本。

PackageDescriptionAPI Reference
effectThe core packagedocs
@effect/platform-browserPlatform services for the browserdocs
@effect/platform-bunPlatform services for Bundocs
@effect/platform-denoPlatform services for Denodocs
@effect/platform-nodePlatform services for Node.jsdocs
@effect/platform-node-sharedShared services for Node.js-compatible runtimesdocs
@effect/sql-clickhouseSQL client for ClickHousedocs
@effect/sql-d1SQL client for Cloudflare D1docs
@effect/sql-libsqlSQL client for libSQLdocs
@effect/sql-mssqlSQL client for Microsoft SQL Serverdocs
@effect/sql-mysql2SQL client for MySQLdocs
@effect/sql-pgSQL client for PostgreSQLdocs
@effect/sql-pgliteSQL client for PGlitedocs
@effect/sql-sqlite-bunSQL client for SQLite via bun:sqlitedocs
@effect/sql-sqlite-doSQL client for Cloudflare Durable Objects SQLitedocs
@effect/sql-sqlite-nodeSQL client for SQLite via node:sqlitedocs
@effect/sql-sqlite-react-nativeSQL client for SQLite in React Nativedocs
@effect/sql-sqlite-wasmSQL client for SQLite compiled to WebAssemblydocs
@effect/ai-anthropicAnthropic provider for the Effect AI modulesdocs
@effect/ai-openaiOpenAI provider for the Effect AI modulesdocs
@effect/ai-cloudflareCloudflare decision provider for the Effect AI modulesdocs
@effect/ai-typesafeTypeSafe decision provider for the Effect AI modulesdocs
@effect/ai-openai-compatOpenAI-compatible API provider for the Effect AI modulesdocs
@effect/ai-openrouterOpenRouter provider for the Effect AI modulesdocs
@effect/atom-reactReact bindings for Effect Atomdocs
@effect/atom-solidSolidJS bindings for Effect Atomdocs
@effect/atom-vueVue bindings for Effect Atomdocs
@effect/opentelemetryOpenTelemetry integrationdocs
@effect/vitestHelpers for testing with Vitestdocs
@effect/docgenDocumentation generator for Effect projectsdocs
@effect/doctestRuns JSDoc examples as Vitest testsdocs
@effect/openapi-generatorGenerate Effect code from OpenAPI specificationsdocs

License

MIT

许可证

MIT