V
V
vmb2015-01-06 02:57:49
Node.js
vmb, 2015-01-06 02:57:49

Is it possible to run a Node.js program without a terminal window?

When a Perl or Python program is run with wperl or pythonw, it runs without a terminal window (command prompt window) appearing. Is there a similar way to run Node.js programs (under Windows)?

Answer the question

In order to leave comments, you need to log in

5 answer(s)
T
Timur Shemsedinov, 2015-01-06
@MarcusAurelius

Like any console program, there are options here: superuser.com/questions/62525/run-a-batch-file-in-...
Or there is this RunAsService program: runasservice.sourceforge.net

A
Alexander Taratin, 2015-01-06
@Taraflex

#include <windows.h>

int APIENTRY WinMain(
        HINSTANCE hInstance,
        HINSTANCE hPrevInstance,
        LPSTR lpCmdLine,
        int nCmdShow
        )
{
  WinExec(lpCmdLine,0);
    return 0;
}

Console utility. Exe can be found here https://yadi.sk/d/3X79cAnFdoahU

V
vsvladimir, 2015-01-06
@vsvladimir

You can make a text file with a script and run a node project in invisible mode.
start.vbs file

Dim objWshShell, lc
set objWshShell = WScript.CreateObject("WScript.Shell")
lc = objWshShell.Run("node app.js", 0, false)
set objWshShell = nothing

But in general, a convenient and flexible node launcher for Windows would not hurt. Now everyone is solving this issue in their own way. There are modules in NPM, but for this purpose, a native Windows solution will be more convenient and reliable.

D
Dimitri, 2015-01-07
@Kvarkas

Maybe it ?

V
vmb, 2015-01-06
@vmb

Thank you. Interestingly, one of the tips from the link is to use pythonw with a script to run cli programs without a terminal) So, as far as I understand, there is no native tool, do I need to add one more link to the chain? Sorry if so. I wonder why the developers didn’t bother with such a tool already familiar to Perl and Python ...
Probably, in extreme cases, you can slightly redo the script and run node-webkit with the show: false field in the manifest, but this is also a crutch for a simple system utility.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question