Installation
Effect ships as a single package, effect, that contains the entire core
library — the Effect type, Schema, Stream, Layer, and much more.
Installing that one package is all you need to start. This page walks you through
creating a fresh, strict TypeScript project and running a first program.
Requirements:
- TypeScript 5.8 or newer (Effect v4 is developed and built against TypeScript 6.x — use the latest release for the best results)
- A runtime: Bun, Node.js 18+, or Deno
Create a project
Section titled “Create a project”-
Create a project directory and move into it:
Terminal window mkdir hello-effectcd hello-effect -
Initialize the project and install TypeScript and Effect:
Terminal window bun init -ybun add effectbun add -d typescriptTerminal window npm init -ynpm install effectnpm install --save-dev typescript tsxTerminal window pnpm initpnpm add effectpnpm add -D typescript tsx -
Generate a
tsconfig.jsonand make sure strict mode is on:bun initalready creates atsconfig.jsonwithstrictenabled. Verify it contains:{"compilerOptions": {"strict": true}}Terminal window npx tsc --initThen open
tsconfig.jsonand confirm:{"compilerOptions": {"strict": true}}Terminal window pnpm tsc --initThen open
tsconfig.jsonand confirm:{"compilerOptions": {"strict": true}}
Write a first program
Section titled “Write a first program”Create a source file:
mkdir -p srctouch src/index.tsAdd the following to src/index.ts. The program is described as a value, then
handed to a runtime to actually run:
import { Console, Effect } from "effect"
// `Effect.gen` builds an effect in imperative style. Nothing runs yet — this is// just a description of the work to be done.const program = Effect.gen(function* () { yield* Console.log("Hello, Effect!")})
// `Effect.runPromise` executes the program and returns a Promise. This is the// boundary between the Effect world (descriptions) and the outside world.Effect.runPromise(program)Run it
Section titled “Run it”bun run src/index.tsnpx tsx src/index.tspnpm tsx src/index.tsYou should see Hello, Effect! printed to the console. That confirms your
project is set up correctly.
Next steps
Section titled “Next steps”Now that everything runs, the Quickstart builds a small but realistic program with services, typed errors, and a Layer. To learn how the package is organized and how to reach the unstable modules (HTTP, CLI, RPC, and more), see Importing Effect.