[Solution] How to make exe(executable) from NodeJS App

 [Solution] How to generate/make exe(executable) from NodeJS App

[Solution] How to make exe(executable) from NodeJS App
Make exe(executable) from NodeJS App
In this article we will solve your all questions Like How to generate exe out of NodeJS App or in other words Is it possible to generate exe out of NodeJS code or i will say make windows executable out of NodeJS App (code)

let's get started with this article in which we are going to discuss how we can generate exe or we can say windows executable using NodeJS App.

To achieve this, there are lot of npm packages are available but in this article we will go ahead and use node-windows npm package.

Below are the steps to generate exe from nodejs app source code.

1) Download nodejs and install nodejs and npm (Skip if you have npm already installed)

2) Into your project root directory execute below command.

npm install node-windows or npm i node -windows

3) create one file into your project's root directory named service.js and copy below code
var Service = require('node-windows').Service;

var svc = new Service({
  description: 'visionfortech nodejs App',
  script: <entry point of your application [app.js or index.js]>,
  execPath: <Node exe path>
  log.info("Service starting ...")
  log.info("Service started ...")

  log.info('Uninstall complete.');
  log.info('The service exists: ',svc.exists);
Above code will create deamon directory into your project's root directory and into that it will create visionfortechnodeapp.exe and two log files.

In case if you are facing any kind of issue/problem please feel free to post it in comment. i will try to resolved as soon as i can.

Hope you enjoyed the article and it got added something new to your knowledge.

To Learn more about Javascript Javascript Treasure.
To add something new every-time into your mind stay tuned to visionfortech.