PM2 utilities for Raycast Extensions
npm install raycast-pm2PM2 utilities for Raycast Extensions
[![raycast-cross-extension-badge]][raycast-cross-extension-link]
``shell`
npm i raycast-pm2
This package follows [Raycast Cross-Extension Conventions][raycast-cross-extension-link].
The extension API command is disabled by default. Remember to enable it from your extension configuration before using.
`typescript
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",
},
);
`
#### commandOptions
##### command
Type: "start" | "stop" | "restart" | "reload" | "delete"
##### options
Type: StartOptions | Pm2Process
Options for running the pm2.start(),
pm2.stop(),
pm2.restart(),
pm2.reload(),
and pm2.delete().
#### launchOptions
Type: Partial
Optional. Options for launch the target command. It has default values for launching the PM2 extension:
- name defaults to apitype
- defaults to LaunchType.BackgroundextensionName
- defaults to pm2ownerOrUserName
- defaults to litomore
#### callbackOptions
Optional. Same as the raycast-cross-extension's callbackOptions`.
- Raycast PM2 - Manage even run your Node.js processes through Raycast
- [Raycast Cross-Extension Conventions][raycast-cross-extension-link] - Defines the development approach for cross-extension in Raycast
CC0-1.0
[raycast-cross-extension-badge]: https://shields.io/badge/Raycast-Cross--Extension-eee?labelColor=FF6363&logo=raycast&logoColor=fff&style=flat-square
[raycast-cross-extension-link]: https://github.com/LitoMore/raycast-cross-extension-conventions