pm2-list-rest

Module to expose `pm2 list` (process description list) as a REST API

Usage no npm install needed!

<script type="module">
  import pm2ListRest from 'https://cdn.skypack.dev/pm2-list-rest';
</script>

README

pm2-list-rest

npm

Module to expose pm2 list (process description list) as a REST API

Usage

Install or update

pm2 install pm2-list-rest

Call the REST API

curl http://localhost:3999/pm2/list

Options

  • Change port (Default is 3999)

    pm2 set pm2-list-rest:port 3999

  • Exclude processes by name (comma separated list. Default is '')

    pm2 set pm2-list-rest:exclude-processes 'pm2-list-rest, other-excluded-process'

  • Include a subset of pm2_env properties only (comma separated list. Default is '', which includes all properties)

    pm2 set pm2-list-rest:include-pm2-env-properties 'node_version, version, unstable_restarts'

  • Good defaults:

    pm2 set pm2-list-rest:exclude-processes 'pm2-list-rest'
    pm2 set pm2-list-rest:include-pm2-env-properties 'prev_restart_delay, exit_code, node_version, version, unstable_restarts, restart_time, created_at, pm_uptime, status,instances, exec_mode, pm_exec_path, max_memory_restart, merge_logs, autorestart, kill_retry_time, watch'
    

Contribute

# Install dependencies
yarn install

# Install the module
pm2 install .

# Test it
curl http://localhost:3999/pm2/list

# Check module logs
pm2 logs pm2-list-rest

# Remove module
pm2 delete pm2-list-rest

License

WTFPL License