Adavnced, producing process manager for Node.js.
Due to runtime reasons, the pm2 package won't work in Raycast extension. We used a PM2 wrapper application under the assets folder to bypass this problem.
The extension will run npm install under the pm2-wrapper folder during the first run.
This extensions follows Raycast Cross-Extension Conventions. You can send Node.js application to PM2 through crossLaunchCommand.
The API command is disabled by default. Remember to enable it from from your extension configuration before using.
Type: "start" | "stop" | "restart" | "reload" | "delete"
Type: StartOptions | Pm2Process
Options for running the pm2.start(),
pm2.stop(),
pm2.restart(),
pm2.reload(),
and pm2.delete().
Type: RuntimeOptions
Optional. Use this option for specifying the runtime properties. The nodePath defaults to Raycast's Node.js process.execPath.
The default nodePath can be changed from extension configuration.
You can use raycast-pm2 to easily access the API:
import path from "node:path";
import { LaunchType, environment } from "@raycast/api";
import { runPm2Command } from "raycast-pm2";
runPm2Command(
  {
    command: "start",
    options: {
      script: path.join(environment.assetsPath, "path-to/your-script.js"),
      name: "your-script",
    },
  },
  {},
  {
    name: "main",
    type: LaunchType.UserInitiated,
    extensionName: "pm2",
    ownerOrAuthorName: "litomore",
  },
);
See CONTRIBUTING.md.
MIT