1

I need to run a node.js server application as a self-contained executable which should be a Windows service. There are several libraries creating either a self-contained executable or which implement a Windows service layer in node.js but do not create a self-contained executable which is a Windows service itself.

Requirements are:

  • node.js server app should be deployed as Windows service (self-contained, win-exe, no node installation on target machine)
  • Windows service should be able to use parameters for node.js server app (e.g. a TCP port number or node_env)
  • it would be great, if some files could be stored beside the service which are used within node.js server app (e.g. SSL certificates)

Does anyone know an open source tool, library or sth. else which does fulfill these requirements and which is maintained well (still supported / developed, no critical old open issues etc.)?

  • https://github.com/zeit/pkg cannot do that ? Btw, cons. should be exe can be quite big containing also whole node.js inside(?). – Jan Aug 02 '19 at 11:55
  • Nope, there is no win service created, just another tool creating a self-contained exe. It doesn't matter if size of exe is big. – Michael Werner Aug 03 '19 at 12:49
  • Why not use C++ and VS Express ? It is industry standard and probably much easier to create a service and not a big difference comparing C++ with STL, etc. and JavaScript. Also even if there would not be any project for Win service it is often possible to open and modify existing (some from Github?) or add some SDK, etc. to have missing windows.h etc. And in full you can use nuget to install libs or download them manually. Or VS Code, but there it is a bit complicated to use msbuild, but some C++ gcc should be easy to get and setup. – Jan Aug 03 '19 at 20:26
  • Hi Tom, thank you for your response. I have good reasons for that approach and the requirements are elaborated. The server app isn't written by myself, it is a special third-party server. There are no alternative implementations, only the one in node.js – Michael Werner Aug 05 '19 at 08:42

0 Answers0