node icon indicating copy to clipboard operation
node copied to clipboard

Silent Mode execution

Open aleeksunder opened this issue 11 years ago • 47 comments

Not an issue, but a feature request.

Since it very usefull to use iojs as script interpreter, the one feature is missing, and I can suggest that many can vote for it - execute script without console window showing.

I'm not really a programmer, and cannot even say is it possible or not to make console application start without creating a window. But if it is possible I think it may be very usefull to have some command line switch, like --background or --hidden to get this stuff.

Another approach to this can be via another executable, for example windows has wscript.exe and cscript.exe to execute scripts in different modes.

Maybe this was discussed and rejected a lot of time in Node project, but since IOJS is a different project I just want to try again =) I know there is a lot of stuff to get this done like binaries that executes console apps in hidden mode, but this is such a little and such a usefull feature so having it bundled within iojs executable will be really awesome, since we don't need another tool for that.

For example: I need my JS script to execute some program, wait for it's finish, and do some stuff after that, maybe depend on exit code or something like that, so I can spawn a new process from script and give it a callback. They key here is that I don't want to see any windows, neither spawned process, nor iojs. And I will not see spawned process, but will see iojs window for all the time the spawned process will work. So this is a bit frustrating.

So my question is: Is this feature can be accepted for consideration by new TC or not?

And if not, can you please provide some info how I can recompile iojs executable to get it run completely silent?

aleeksunder avatar Jan 22 '15 12:01 aleeksunder

@poiru @s-h-a-d-o-w please feel free to discuss this and reach consensus, and feel free to reopen this if you feel it should be. I just closed this because it's technically resolved and there was no activity. You'd also want to ask someone to work on this, or submit a PR yourself. We cannot just keep it open.

ryzokuken avatar Jun 06 '18 02:06 ryzokuken

It is also required for Proton Native and other NodeJS libui-based frameworks. The main concern is not technical issue, but increased maintenance costs — on Linux and macOS electron-builder can use officially provided NodeJS executables, but on Windows we need to maintain LaunchUI and build it for each NodeJS version. Even if appveyor offers free build service for everyone to build custom, it is not convenient for users.

develar avatar Nov 17 '18 19:11 develar

Can anyone help to achieve same for macos?

bittu avatar May 03 '19 12:05 bittu

@bittu I always thought that MacOS is like Linux in this respect. Linux need no nodew (as well as javaw, pythonw, rubyw etc), so does MaxOS.

ukoloff avatar May 05 '19 16:05 ukoloff

You can use this module: create-windowless-app

This module:

  1. Create a "hello world" project structure (javascript or typescript) that compiles into an exe file (using nexe, with configurable nodejs version)
  2. Compiles a c# launcher (with an option to provide an icon) that can start the project exe in a silent mode. (source included)

yoavain avatar Oct 03 '19 18:10 yoavain

You can use this module: create-windowless-app

This module:

  1. Create a "hello world" project structure (javascript or typescript) that compiles into an exe file (using nexe, with configurable nodejs version)
  2. Compiles a c# launcher (with an option to provide an icon) that can start the project exe in a silent mode. (source included)

I just created a template repository from this module (if you prefer not to run it yourself)

yoavain avatar Sep 17 '21 07:09 yoavain

Quite crazy that this is not a solved problem. For now I rely on cmd /c start /min node.exe file.js but that's far from ideal.

Niek avatar Feb 24 '24 13:02 Niek