1.0.0 • Published 4 years ago
@keeex/pm2-status v1.0.0
@keeex/pm2-status
Detect if the current process is running under PM2 and provide some settings from it.
This library provides three functions:
- isPM2(): return true if running under PM2
- getInstanceId(): return the identifier of the current instance, or- undefinedif not applicable.
- isLogTimestamped(): return true if running under PM2 and log timestamp is enabled
Installation
Install from npmjs:
npm install @keeex/pm2-statusUsage
Import named functions from default export
import {isPM2} from "@keeex/pm2-status";
if (isPM2()) {
  console.log("Yep, under PM2");
}1.0.0
4 years ago