New Node.js Features: Auto Reload, TypeScript, SQLite, and More

Five Modern Features of Node js If you’ve been working with Node.js for a while, you probably remember a small code change meant restarting with nodemon, running TypeScript needed extra tools, and even a simple database required installing separate packages. But the new Node.js has completely evolved! Many things that used to depend on third-party libraries are now built-in. In short — Node can now do a lot more by itself! Here are some of the coolest updates 1. Auto Reload (Watch Mode) Just add --watch, and your app will automatically restart on code changes — no more nodemon needed Example: node --watch index.js Super smooth and instant reloads while coding 2. Run Scripts Easily You can now run scripts directly without typing npm run. Example: node --run dev Cleaner, shorter commands — and a faster workflow 3. Built-in TypeScript Support Starting from Node 22.6+, you can run .ts files directly! Example: node app.ts No need for ts-node or manual compilers anymore — TypeScript just works out of the box 4. Built-in SQLite Module Since Node 22.5, there’s a native node:sqlite module — perfect for lightweight or hobby projects! Example: import sqlite from 'node:sqlite'; const db = await sqlite.open('data.db'); await db.exec('CREATE TABLE users (id INTEGER, name TEXT)'); No extra database packages required anymore 5. .env Files without dotenv Since Node 20.6.0, you can instead use Node’s built-in .env file support by adding the --env-file flag to the node command. Example: node --env-file=.env my-app.js The best part: Fewer dependencies → less setup hassle More built-in features → cleaner code More time to focus on what matters: writing great code I’m currently revisiting some of my old projects — seeing where I can use these new features to make the codebase cleaner and lighter. Have you tried the new Node.js features yet? Which one do you find most useful? Let’s discuss in the comments!   #NodeJS #BackendDevelopment #JavaScript #WebDevelopment #TechUpdate #LearningJourney #ModernJS

To view or add a comment, sign in

Explore content categories