Packages

effect

4.1.4 · 11 Nov 2026MIT66.6M / weekRepositoryHomepagenpmAtom feed

Your version

3.1.0

30 Apr 2024Where it was published

3.22.5 is the newest release of 3.x.

In short

7 new

Security

2 advisories affect 3.1.0; 3.22.1 fixes them

Release note

Minor Changes

  • Add SortedMap.lastOption & partition apis

  • Add Types.DeepMutable, an alternative to Types.Mutable that makes all properties recursively mutable

  • Add Effect.annotateLogsScoped

    This api allows you to annotate logs until the Scope has been closed.

    import { Effect } from "effect";
    
    Effect.gen(function* () {
      yield* Effect.log("no annotations");
      yield* Effect.annotateLogsScoped({ foo: "bar" });
      yield* Effect.log("annotated with foo=bar");
    }).pipe(Effect.scoped, Effect.andThen(Effect.log("no annotations again")));
  • Added Stream.fromEventListener, and BrowserStream.{fromEventListenerWindow, fromEventListenerDocument} for constructing a stream from addEventListener

  • Add kind property to Tracer.Span

    This can be used to specify what kind of service created the span.

  • Add Effect.timeoutOption

    Returns an effect that will return None if the effect times out, otherwise it
    will return Some of the produced value.

    import { Effect } from "effect";
    
    // will return `None` after 500 millis
    Effect.succeed("hello").pipe(
      Effect.delay(1000),
      Effect.timeoutOption("500 millis"),
    );
  • Add $is & $match helpers to Data.TaggedEnum constructors

    import { Data } from "effect";
    
    type HttpError = Data.TaggedEnum<{
      NotFound: {};
      InternalServerError: { reason: string };
    }>;
    const { $is, $match, InternalServerError, NotFound } =
      Data.taggedEnum<HttpError>();
    
    // create a matcher
    const matcher = $match({
      NotFound: () => 0,
      InternalServerError: () => 1,
    });
    
    // true
    $is("NotFound")(NotFound());
    
    // false
    $is("NotFound")(InternalServerError({ reason: "fail" }));

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.