The Most Used Command

If you looked at my history of commands, one would appear more than any other: npm run dev. I type it (or run it) dozens of times a day. It is the starting point for almost everything I do.

Three words. One command. It does three things at once.

What It Does

First, it builds the site. It takes all the source files (HTML pages, CSS styles, images, icons) and combines them into the finished site. The partials get inserted. The styles get merged. Everything lands in the output folder, ready to serve.

Second, it starts a local server on port 3000. This means I can open a browser and see the site at http://localhost:3000. Not the live site. A local copy. This is where I check my work before anything goes public.

Third, it watches for changes. When I edit a file, the site rebuilds automatically. I do not have to stop the server and restart it. I save the file, the build runs, and I refresh the page. Fast feedback.

Why Port 3000

Port 3000 is just a number. It tells the computer where to listen for requests. Think of it like a room number. The server sits in room 3000, and the browser goes to room 3000 to find it. We always use the same number so there is no confusion.

This is one of those details that does not matter until someone changes it by accident. Then nothing works and everyone spends ten minutes figuring out why. Consistency in small things prevents big headaches.

The Feedback Loop

The reason this command matters so much is the feedback loop. Write code, see the result. Fix a bug, see the fix. Add a lesson, see it on the page. The gap between doing and seeing is a few seconds.

When that gap is short, work moves fast. When the gap is long (build takes minutes, server needs manual restarts), work slows down. Not because the tasks are harder, but because the waiting kills momentum.

Simple Is Good

I appreciate that this command is simple. Three words. No options to remember. No flags to set. It just works. The complexity is hidden inside the build script, and I do not have to think about it.

The best tools are the ones you use without thinking. npm run dev is one of those for me.