Hot to set windows console title while npm is running?

I began to develop a Web application project on your computer with Windows, for which I use npm , bower and the HTTP-server nodejs .

To facilitate starting the HTTP server, I created a batch file:

@echo off
title HTTP Server
npm start

npm startlaunches http-server. For this, I have the following entry in packages.json:

"start": "http-server -a localhost -p 8000 -c-1"

But when I double-click the batch, the title of the opening console window first changes to npm, and then to bower. Therefore, it ignores my own title at run time npm/ bower.

Since I have many console windows open, I would like the console window HTTP serverto have its own specific title. How can I achieve this?

+5
source share
2 answers

Set the header in your file packages.json:

"start": "title HTTP Server && http-server -a localhost -p 8000 -c-1"
+8
source

You can set the title in app.js by adding the following line:

process.title = "HTTP Server";
0
source

All Articles