# pm2-ctl

> PM2 API Extention

Latest version **0.0.2** (published 2022-07-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install pm2-ctl
pnpm add pm2-ctl
yarn add pm2-ctl
bun add pm2-ctl
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2022-07-11 |
| First published | 2022-07-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 12.3 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | BolverBlitz |
| Maintainers | bolverblitz |
| Keywords | PM2 |

## Links

- npm: https://www.npmjs.com/package/pm2-ctl
- npm.io page: https://npm.io/package/pm2-ctl

## Dependencies (1)

- [pm2](https://npm.io/package/pm2.md) ^5.2.0

## Recent versions

- 0.0.2 (latest) — 2022-07-11
- 0.0.1 — 2022-07-05

## README

# PM2 - Control
## Introduction
I love PM2 but the API leaves a lot to be desired, so I developed this module.
Unique functions are e.g. GetMe or GetMyCluster

## When should you use this?
If you want to manage a PM2 instance via JS, you'll benefit from the simplified functions that return promises.

## Usage
Every function is explained with JSDoc.  

## Example
This will return all information avaible from all the processes that are in the same cluster as the process you called it from.  
If you called it from a process that isn´t part of PM2 then it will return a error. 
```js
const pm2 = require('./index.js')

pm2.GetMyCluster.ID().then(function (data) {
        data.map(function (item) {
            console.log(item.pm_id, item.pm2_env.instances)
            //console.log(item)
        });
    }).catch(function (err) {
        console.log(err)
});
```

---
_Source: https://npm.io/package/pm2-ctl · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
