github Effect-TS/effect @effect/platform@0.48.26

latest releases: @effect/typeclass@0.29.14, @effect/vitest@0.13.14, @effect/sql-sqlite-wasm@0.20.5...
7 months ago

Patch Changes

  • #2477 365a486 Thanks @tim-smart! - add PlatformConfigProvider module

    It contains a file tree provider, that can be used to read config values from a file tree.

    For example, if you have a file tree like this:

    config/
      secret
      nested/
        value
    

    You could do the following:

    import { PlatformConfigProvider } from "@effect/platform";
    import { NodeContext } from "@effect/platform-node";
    import { Config, Effect, Layer } from "effect";
    
    const ConfigProviderLive = PlatformConfigProvider.layerFileTree({
      rootDirectory: `/config`,
    }).pipe(Layer.provide(NodeContext.layer));
    
    Effect.gen(function* (_) {
      const secret = yield* _(Config.secret("secret"));
      const value = yield* _(Config.string("value"), Config.nested("nested"));
    }).pipe(Effect.provide(ConfigProviderLive));

Don't miss a new effect release

NewReleases is sending notifications on new releases.