on-server
Version:
Run shell commands in the browser
13 lines (10 loc) • 354 B
text/typescript
import { spawn } from "child_process";
console.log("Stopping on-server");
const pm2Proc = spawn("pm2", ["stop", "dist/pm2.config.js"], { shell: true });
pm2Proc.stdout.pipe(process.stdout);
pm2Proc.on("exit", (code) => {
console.log(
code == 0 ? "on-server stopped successfully" : "on-server failed to stop"
);
});