In this tutorial, we will guide you through the process of setting up a new Effect project from scratch using plain TypeScript 5.0 or newer.

Follow these steps to create a new Effect project for Node.js:

  1. As a first step, create a project directory and navigate into it:

    mkdir hello-effect
    cd hello-effect
  2. Next, initialize a TypeScript project using npm (make sure you have TypeScript 5.0 or newer):

    npm init -y
    npm install typescript --save-dev

    This creates a package.json file with an initial setup for your TypeScript project.

  3. Now, initialize TypeScript:

    npx tsc --init

    When running this command, it will generate a tsconfig.json file that contains configuration options for TypeScript. One of the most important options to consider is the strict flag.

    Make sure to open the tsconfig.json file and verify that the value of the strict option is set to true.

      "compilerOptions": {
        "strict": true
  4. Then, install the necessary package as dependency:

    npm install effect

    This package will provide the foundational functionality for your Effect project.

Let's write and run a simple program to ensure that everything is set up correctly.

In your terminal, execute the following commands:

mkdir src
touch src/index.ts

Open the index.ts file and add the following code:

import { Effect, Console } from "effect"
const program = Console.log("Hello, World!")

Run the index.ts file. If you have ts-node (opens in a new tab) installed, run the following command in the terminal:

ts-node src/index.ts

You should see the message "Hello, World!" printed. This confirms that the program is working correctly.