const Service = require("node-windows").Service; const path = require("path"); const svc = new Service({ name: "Image Moderation Service", script: path.join(__dirname, "dist", "server.js"), }); svc.on("uninstall", () => { console.log("Service uninstalled."); }); svc.uninstall();