Socket
Socket
Sign inDemoInstall

pm2ship

Package Overview
Dependencies
597
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    pm2ship

a pm2 api wrapper


Version published
Weekly downloads
3
Maintainers
1
Install size
29.6 MB
Created
Weekly downloads
 

Readme

Source

create a startup.coffee file

pm2Ship = require './lib/pm2/pm2Ship'
argv = require('yargs').argv;
config = require 'config'

apps = config.get 'pm2Ship.apps'

pm2Ship.app apps
.then (startedApps) ->
  for startedApp in startedApps
    console.log 'started:',startedApp
.catch (err) ->
  console.log 'err',err

process.on 'errException', (exception) ->
  console.log 'exception:', exception

sample config:

pm2Ship:
  apps:
#    Backend can not cluster by PM2 we use Nginx -> so duplicate by config
    -
      script: 'backend.coffee'
      nodename: pusher
      instances: 1
      max_memory_restart : '100M'
      exec_mode : 'cluster'
      env:
        PORT: 13000
    -
      script: 'backend.coffee'
      nodename: pusher
      instances: 1
      max_memory_restart : '100M'
      exec_mode : 'cluster'
      env:
        PORT: 13001

    -
      script: 'heartbeats.coffee'
      nodename: pusher
      instances: 1
      max_memory_restart : 100M
      exec_mode : cluster
      env:
        PORT: 0

coffee config

module.exports =
  pm2Start:
    apps: [
      {
      'script': 'myapp.coffee'
      'nodename': 'myHackingApp'
      'max_memory_restart': '100M'
      'instances': 1
      'exec_mode': 'cluster'
      }
    ]
      

Keywords

FAQs

Last updated on 10 Sep 2015

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc