@effect-ts/core

中文文档
0.60.5发布于 2022/12/21MITESM + CJS近 30 天下载 43.9万

Effect-TS is a zero dependency set of libraries to write highly productive, purely functional TypeScript at scale.

原始使用文档
文档目录8 节
  1. Welcome to Effect-TS
  2. Install
  3. Get in touch
  4. Articles
  5. Documentation
  6. Examples
  7. Maintainers
  8. Contributors

Welcome to Effect-TS

Effect-TS is a zero dependency set of libraries to write highly productive, purely functional TypeScript at scale.

The main driver of inspiration and the source of most of the ideas politely borrowed by this library is the core ZIO and its ecosystem of libraries, in particular ZIO-Prelude from which we take the naming and design of a highly innovative typeclass system.

Within the TypeScript ecosystem, this library takes inspiration from fp-ts, io-ts, morphic-ts, waveguide, qio and please forgive us if we are forgetting some.

Before anything we would like to say THANK YOU to all the contributors and authors of all the libraries we took something from, this work would have not been possible without you!

Just like ZIO in scala, which was taken as source-code reference for the typescript port, @effect-ts/core/Effect is powered by highly-scalable, non-blocking fibers that never waste or leak resources, Effect lets you build scalable, resilient, and reactive applications that meet the needs of your business.

  • High-performance. Build scalable applications with greater performance compared to Promise.
  • Type-safe. Use the full power of the TypeScript compiler to catch bugs at compile time.
  • Concurrent. Easily build concurrent apps without deadlocks, race conditions, or complexity.
  • Asynchronous. Write sequential code that looks the same whether it's asynchronous or synchronous.
  • Resource-safe. Build apps that never leak resources, even when they fail.
  • Testable. Inject test services into your app for fast, deterministic, and type-safe testing.
  • Resilient. Build apps that never lose errors, and which respond to failure locally and flexibly.
  • Functional. Rapidly compose solutions to complex problems from simple building blocks.
  • Stack Safe. Forget ever seeing again Maximum call stack size exceeded and profit.

Within the ecosystem of packages you will find:

  • @effect-ts/core The main entry point of the library, contains the effect system, the typeclasses inspired by zio-prelude and a set of commonly used modules like Sync, Array, Option, and many more.

  • @effect-ts/jest The main entry point for testing, provides an integration to jest of a test runtime based on managed effect layers that support Effect as first class citizen.

  • @effect-ts/monocle Based on a fork of monocle-ts experimental modules this library offers low boilerplate optics for your needs.

  • @effect-ts/morphic Based on a fork of morphic-ts this library provides derivation of common typeclasses like Decoder, Encoder, Guard in a highly configurable manner and utilities around ADT in general data-modelling needs.

  • @effect-ts/tracing-plugin This typescript compiler plugin, to be used with ttypescript, can be configured to:

    • add compile time traces to your application code
    • reduce the calls to pipe
    • reduce the calls to flow
    • reduce the calls to identity
    • optimize data-last pipeable functions to data-first

Install

We recommend the usage of yarn and if you have multiple packages the usage of yarn workspaces that handles by default hoisting of dependencies:

yarn add @effect-ts/core

Get in touch

Join us using discord at: https://discord.gg/hdt7t7jpvn

Articles

If you like to know more check out our, incomplete, series of articles:

Documentation

This is not an excuse, we will write docs when the active development slows down but:

Functional libraries tend to have almost no documentation and the reason is that the best documentation for a function is its own definition assuming the name is meaningful and the types are clear.

For the reason above, when we will begin documenting it, it will be along the lines of a guide in order to introduce concepts used in the library rather than just an "online database of function definitions"

Examples

Maintainers

This library is actively maintained by Matechs-Garage the R&D leg of the Matechs group that sponsor its development.

Contributors

Many thanks to all contributors of this amazing project, many of you have contributed from functionality up to bug reporting and fixing this library would have been nowhere near without your work. If you are interested to join us then reach out (regardless of your experience)!

版本与发布记录

@effect-ts/core 共发布 500 个版本,首次发布于 2020/08/21;过去 12 个月发布了 0 个版本。

版本发布日期距今
0.60.5latest2022/12/213 年前
0.60.42022/09/034 年前
0.60.32022/08/114 年前
0.60.22022/06/074 年前
0.60.12022/04/264 年前
0.60.02022/04/144 年前

其他发布通道:next → 0.28.3-alpha.1。

关于 @effect-ts/core 的常见问题

@effect-ts/core 是什么?

Effect-TS is a zero dependency set of libraries to write highly productive, purely functional TypeScript at scale.

如何安装 @effect-ts/core?

在项目目录运行 npm install @effect-ts/core,或使用 pnpm add / yarn add / bun add。

@effect-ts/core 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/effect-ts__core 是否存在。

@effect-ts/core 支持 ESM 还是 CommonJS?

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

@effect-ts/core 可以商用吗?

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

@effect-ts/core 的下载量有多少?

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

@effect-ts/core 还在维护吗?

最新版本 0.60.5 发布于 2022/12/21(3 年前);至今共发布 500 个版本,其中过去 12 个月发布了 0 个;首次发布于 2020/08/21。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。