Adavnced, producing process manager for Node.js.
The extension uses the pm2 package directly through PM2's programmatic API. Some optional PM2 CLI dependencies are marked as external for Raycast's build step because they are not used by this extension's list and process-management commands.
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