Run NPM Scripts with PM2

Tags
Run scripts from your package.json with pm2

I've had to search for this answer so many times I thought I'd put it up here instead.

pm2 start npm --name 'My Process' -- run scriptName

I run a lot of things in yarn workspaces so I find myself using it frequently like this:

pm2 start yarn --name 'My Other Process' -- workspace @bjk/package run scriptName

Let's stay in touch!

Follow me ontwitter