const {Service} = require('node-windows') const path = require('path') const service = new Service({ name: 'PDF Editor', description: 'PDF Editor Microservice', script: path.join(__dirname, 'server.js') }) const command = process.argv[2] switch (command) { case 'install': service.install(); break; case 'start': service.start(); break; case 'stop': service.stop(); break; case 'uninstall': service.uninstall(); break; }