A Modern Node.js + TypeScript Setup for 2025 🚀
Sibelius Seraphini

Sibelius Seraphini @sibelius

About: CoFounder Woovi

Location:
Florianopolis, SC
Joined:
Apr 9, 2019

A Modern Node.js + TypeScript Setup for 2025 🚀

Publish Date: Jan 29
257 18

With the latest features and tools in Node.js, setting up a modern TypeScript project has never been easier—or more exciting. This guide will show you how to leverage the newest Node.js capabilities to create a lightweight and efficient development workflow.

Why Choose This Setup?

This setup emphasizes simplicity, native features, and minimal dependencies by leveraging:

  • Native ESM (ECMAScript Modules) for cleaner, modern syntax.
  • Experimental TypeScript Stripping (--experimental-strip-types) for running TypeScript files natively.
  • Built-in File Watching without third-party tools like nodemon
  • Native Environment Variable Support with .env files

Explore the repo for this setup: esm-pure-experimental-strip-types.

Node.js ESM

ECMAScript Modules (ESM) bring modern syntax with import and export.

Benefits of ESM:

  • Performance: Static analysis of imports/exports improves optimization compared to CommonJS (CJS).
  • Simplified Module Resolution: Requires explicit file extensions, speeding up module resolution. For example, instead of:
const module = require('./module');
Enter fullscreen mode Exit fullscreen mode

You now write:

import module from './module.js';
Enter fullscreen mode Exit fullscreen mode

Experimental TypeScript stripping (--experimental-strip-types)

The --experimental-strip-types flag lets you run .ts files directly in Node.js, eliminating the need for transpilers like Babel or SWC. Here's how to use it:

node --experimental-strip-types index.ts
Enter fullscreen mode Exit fullscreen mode

Requirements:

  • Use ESM syntax.
  • Include explicit file extensions (e.g., .ts) in imports.

Here’s a sample tsconfig.json to get you started:

{
  "$schema": "https://json.schemastore.org/tsconfig",
  "compilerOptions": {
    "target": "ES2022",
    "module": "ESNext",
    "moduleResolution": "Node",
    "strict": true,
    "esModuleInterop": true,
    "forceConsistentCasingInFileNames": true,
    "skipLibCheck": true,
    "isolatedModules": true,
    "resolveJsonModule": true,
    "outDir": "./dist",
    "rootDir": "./src",
    "noEmit": true,
    "types": ["node"],
    "allowImportingTsExtensions": true,
    "verbatimModuleSyntax": true,
    "incremental": true
  },
  "include": ["src/**/*.ts"],
  "exclude": ["node_modules", "dist"]
}
Enter fullscreen mode Exit fullscreen mode

Key Configurations:

  • allowImportingTsExtensions: Ensures .ts extensions are required in imports.
  • verbatimModuleSyntax: This avoids altering your import/export syntax. By using --experimental-strip-types, you can bypass tools like Babel, SWC, Webpack, or TSX, streamlining your toolchain significantly.

Built-in File Watching (--watch)

Forget nodemon! Node.js now supports file watching natively. Use the --watch flag for live reloads:

node --watch index.ts
Enter fullscreen mode Exit fullscreen mode

Benefits:

  • Faster and more efficient than nodemon.
  • Native support means fewer dependencies.

Native Environment Variable Support (--env-file)

You no longer need packages like dotenv or dotenv-safe to handle .env files. Simply use the --env-file flag:

node --env-file=.env index.ts
Enter fullscreen mode Exit fullscreen mode

Advantages:

  • Seamless integration with .env files.
  • Fully native functionality, reducing dependency bloat.

Closing Thoughts

This modern Node.js + TypeScript setup eliminates unnecessary complexity by leveraging the latest features. With native ESM, experimental TypeScript stripping, built-in file watching, and .env support, you can:

  • Reduce dependencies.
  • Improve performance.
  • Simplify your workflow.

By embracing these tools, you’ll boost productivity and focus on building, not configuring.

What are your favorite Node.js + TypeScript features? Let me know in the comments!


Woovi is a fintech platform revolutionizing how businesses and developers handle payments in Brazil. Built with a developer-first mindset, Woovi simplifies integration with instant payment methods like Pix, enabling companies to receive payments seamlessly and automate financial workflows.

If you want to work with us, we are hiring!

Comments 18 total

  • Bhat Aasim
    Bhat AasimJan 30, 2025

    Hey, I'm looking for a role.
    Here is my portfolio bhataasim-portfolio.vercel.app/

    • Varun Deva
      Varun DevaJan 30, 2025

      It's clean and structured
      Is this repo available to fork and rebuild on top of it?

      • Bhat Aasim
        Bhat AasimJan 30, 2025

        Yes, checkout magic ui templates

  • Ayne Abreham Alemayehu
    Ayne Abreham AlemayehuJan 30, 2025

    Can you create a blog on express/typescript project deployment on vercel or render I have faced issues on that even after following their docs and YouTube tutorials?
    Thank you again 💓

    • Rasheed Bustamam
      Rasheed BustamamJan 30, 2025

      I can write one for you :)

    • Eric Zingeler
      Eric ZingelerJan 30, 2025

      Figure it out yourself. Doing is the best way to learn.

      • Michael Rosata
        Michael RosataFeb 27, 2025

        Sounds like OP did try to figure it out themselves and believed there might be value for them and others if the author of this article wrote a blog post about it.

  • G.V.S Akhil
    G.V.S AkhilJan 30, 2025

    I prefer using nestjs instead of doing all these myself. By the way nice article, Thanks 🙏

    • Eric Zingeler
      Eric ZingelerJan 30, 2025

      This is a very basic setup that literally takes 5 minutes. It’s good for everyone to understand how to spin up a vanilla Node + TypeScript app.

  • Sujit Singh
    Sujit SinghJan 30, 2025

    Nice article Aasim Sibelius!

    Just a small suggestion - may be you can also add appropriate node version/s which support these features and flags.

  • Michael Nannola
    Michael NannolaJan 30, 2025

    One thing, starting with Node v.23 you don't need the strip types flag. It's on by default.
    nodejs.org/en/learn/typescript/run...

  • Niklas Schäffer
    Niklas SchäfferJan 30, 2025

    This setup alone probably does not get the job done at all. You don't have a buildin module Bundler in Node nore do you have an Html,Sass compiler. This is very basic but if you want you could do some basic coding.

  • Lepe
    LepeJan 30, 2025

    You generated an article using AI on a topic you know nothing about and the result is nonsense text. Good one.

    • Scarlet Rose
      Scarlet RoseJan 31, 2025

      Actually Woovi is a pioneer using these bleeding edge technologies, I believe you are mistaken, but it is okay do be wrong sometimes.

  • mobisoftinfotech
    mobisoftinfotechFeb 18, 2025

    Great read on A Modern Node.js + TypeScript Setup for 2025! Your insights on ESM, TypeScript stripping, and built-in file watching are super helpful for simplifying workflows.

    i came accross AWS SQS & SNS tutorial "mobisoftinfotech.com/resources/blo..." that explores event-driven architecture with NestJS & TypeScript: AWS SQS & SNS tutorial.

    How do you see AWS SQS and SNS fitting into a TypeScript-based Node.js setup?

Add comment