Follow the steps below to create a Node.js project:
Creating a Project
Create a new directory and initialize a Node.js project:
mkdir effect-configcd effect-configpnpm initInstalling Dependencies
Run the following command to install the required packages:
pnpm add effect@4.0.0-beta.50pnpm add -D typescript tsx @types/nodeConfiguring the Project
Add "type": "module" to your package.json to enable ES modules:
{ "name": "effect-config", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "keywords": [], "author": "", "license": "ISC", "type": "module", "packageManager": "pnpm@10.28.0", "dependencies": { "effect": "4.0.0-beta.50" }, "devDependencies": { "@types/node": "^25.6.0", "tsx": "^4.21.0", "typescript": "^6.0.3" }}Create a tsconfig.json in the project root:
{ "compilerOptions": { "target": "ES2022", "module": "nodenext", "moduleResolution": "nodenext", "strict": true, "skipLibCheck": true, "forceConsistentCasingInFileNames": true, "outDir": "./dist" }, "include": ["*.ts"]}Creating a TypeScript File
Create a file named config.ts in the project root. This is the file where we’ll write all of our code.
Running TypeScript Files
To run a file, use the command npx tsx followed by the file name:
npx tsx config.ts