Packages

effect

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

Your version

3.4.0

21 Jun 2024Where it was published

3.22.5 is the newest release of 3.x.

In short

10 new

Security

2 advisories affect 3.4.0; 3.22.1 fixes them

Release note

Minor Changes

  • Make Option.liftPredicate dual

  • Add Effect.liftPredicate

    Effect.liftPredicate transforms a Predicate function into an Effect returning the input value if the predicate returns true or failing with specified error if the predicate fails.

    import { Effect } from "effect";
    
    const isPositive = (n: number): boolean => n > 0;
    
    // succeeds with `1`
    Effect.liftPredicate(1, isPositive, (n) => `${n} is not positive`);
    
    // fails with `"0 is not positive"`
    Effect.liftPredicate(0, isPositive, (n) => `${n} is not positive`);
  • Add EventListener type to Stream to avoid use of dom lib

  • Add lastNonEmpty function to Chunk module, closes #2946

  • Stream: Implement Success, Error, Context type accessors

  • Add Micro module

    A lightweight alternative to Effect, for when bundle size really matters.

    At a minimum, Micro adds 5kb gzipped to your bundle, and scales with the amount
    of features you use.

  • Add ManagedRuntime type utils (Context, and Error)

  • Add Either.liftPredicate

  • Add Tuple.at api, to retrieve an element at a specified index from a tuple.

    import { Tuple } from "effect";
    
    assert.deepStrictEqual(Tuple.at([1, "hello", true], 1), "hello");
  • Add ensure util for Array, used to normalize A | ReadonlyArray<A>

    import { ensure } from "effect/Array";
    
    // lets say you are not 100% sure if it's a member or a collection
    declare const someValue: { foo: string } | Array<{ foo: string }>;
    
    // $ExpectType ({ foo: string })[]
    const normalized = ensure(someValue);

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.