Packages

effect

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

Your version

3.19.4

17 Nov 2025Where it was published

3.22.5 is the newest release of 3.x.

In short

1 new1 fixed

Security

2 advisories affect 3.19.4; 3.22.1 fixes them

Release note

Patch Changes

  • Fix Types.DeepMutable mapping over functions

  • Add experimental PartitionedSemaphore module

    A PartitionedSemaphore is a concurrency primitive that can be used to
    control concurrent access to a resource across multiple partitions identified
    by keys.

    The total number of permits is shared across all partitions, with waiting
    permits equally distributed among partitions using a round-robin strategy.

    This is useful when you want to limit the total number of concurrent accesses
    to a resource, while still allowing for fair distribution of access across
    different partitions.

    import { Effect, PartitionedSemaphore } from "effect"
    
    Effect.gen(function* () {
      const semaphore = yield* PartitionedSemaphore.make<string>({ permits: 5 })
    
      // Take the first 5 permits with key "A", then the following permits will be
      // equally distributed between all the keys using a round-robin strategy
      yield* Effect.log("A").pipe(
        Effect.delay(1000),
        semaphore.withPermits("A", 1),
        Effect.replicateEffect(15, { concurrency: "unbounded" }),
        Effect.fork
      )
      yield* Effect.log("B").pipe(
        Effect.delay(1000),
        semaphore.withPermits("B", 1),
        Effect.replicateEffect(10, { concurrency: "unbounded" }),
        Effect.fork
      )
      yield* Effect.log("C").pipe(
        Effect.delay(1000),
        semaphore.withPermits("C", 1),
        Effect.replicateEffect(10, { concurrency: "unbounded" }),
        Effect.fork
      )
    
      return yield* Effect.never
    }).pipe(Effect.runFork)

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.