6 Node.js Features You Should Know

Node.js Updates That Deserve More Hype 6 Node.js features that quietly landed over the past few releases and can make your dev life easier: 1. Built-in Watch Mode No more `nodemon` installs. Since Node.js v18.11 (and stable in v22), you can just run node --watch index.js Your app restarts automatically when files change. One less dependency, one less headache. 2. node --run Scripts In Node.js v22+, you can run package.json scripts directly using: node --run start No npm run, no npx, just faster startup. Feels weirdly satisfying. 3. Built-in TypeScript Type-Stripping Node.js v22.6+ can run .ts files directly using experimental type-stripping. It doesn’t fully compile TS, but it removes the need for a build step in small projects. It’s not perfect, but it’s dangerously convenient. 4. Built-in SQLite Module (Experimental) Since Node.js v22.5, there’s a native sqlite module. No `better-sqlite3`, no external C bindings — just import sqlite from 'node:sqlite'. Perfect for small apps, prototypes, and dev tools. 5. Promise-based Timers Tired of setTimeout(callback, 1000)? Try this instead: await import('node:timers/promises').then(t => t.setTimeout(1000)) Promise-based timers since Node.js v15 — clean and async-native. 6. Built-in .env Support Since Node.js v20.6, you can load environment variables with: node --env-file=.env app.js Goodbye `dotenv` — your .env just became first-class. #NodeJS #BackendDevelopment #JavaScript #FullStack #WebDevelopment #TypeScript #Developers #ProgrammingTips

  • 6 Node.js Features Even AI Missed. You Don’t Need nodemon or dotenv Anymore

`setTimeout(callback, 1000)` and `await import('node:timers/promises').then(t => t.setTimeout(1000))` are not equivalent

Like
Reply
See more comments

To view or add a comment, sign in

Explore content categories