Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pm-msg

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pm-msg

send message to PM2 process, start, delete, sendMsg

  • 1.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

pm-msg

Programatic PM2 process.
Start, delete, sendMsg by pm2 api using typescript.
When start a pm2 process by name, will check if the name exist, if exist, will delete it then start.
When kill a pm2 process by name, will check if it exsit, also will check if it is killed successfully.

INSTALL

npm install --save pm-msg

USAGE

start a pm2

import { pmMsg } from 'pm-msg'

pmMsg.start({
  script:             './example/script.ts',    
  instances:          2,    
  name:               'script',       
  max_memory_restart: '100M'          
})

kill a pm2

import { pmMsg } from 'pm-msg'
pmMsg.kill('script')

send message to a pm2 process by pm2 name

import { pmMsg } from 'pm-msg'
pmMsg.send('script', {
  data: { msg: 'send message: Hi, what is your name?' },
  topic: 'login'
})

DOC

see auto-generate doc

disconnect

The following function will disconnect automatically after done

  • start
  • send
  • kill

connect

The following function should call pmMsg.disconnect() at the end

  • pmList
  • pmNameExsit
  • getProcess
  • receive

Keywords

FAQs

Package last updated on 03 Nov 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc