var Service = require('node-windows').Service; var svc = new Service({ name:'DPACKGetData', description: 'This application will fetch data from DPACK database and send it Primary Database', script: require('path').join(__dirname, 'server.js'), env:{ name: "NODE_ENV", value: "production" } }); // Listen for the "uninstall" event so we know when it's done. svc.on('uninstall',function(){ console.log('Uninstall complete.'); console.log('The service exists: ',svc.exists); }); // Uninstall the service. svc.uninstall();