raycast-pm2
v0.2.0
Published
PM2 utilities for Raycast Extensions
Downloads
4
Maintainers
Readme
raycast-pm2
PM2 utilities for Raycast Extensions
Install
npm i raycast-pm2
Usages
This package follows Raycast Cross-Extension Conventions.
The extension API command is disabled by default. Remember to enable it from your extension configuration before using.
Example
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",
},
);
API
runPm2Command(commandOptions, launchOptions?, callbackOptions?)
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<LaunchOptions>
Optional. Options for launch the target command. It has default values for launching the PM2 extension:
name
defaults toapi
type
defaults toLaunchType.Background
extensionName
defaults topm2
ownerOrUserName
defaults tolitomore
callbackOptions
Optional. Same as the raycast-cross-extension
's callbackOptions
.
Related
- Raycast PM2 - Manage even run your Node.js processes through Raycast
- Raycast Cross-Extension Conventions - Defines the development approach for cross-extension in Raycast
License
CC0-1.0