Categories
JavaScript Answers

How to pass execution arguments to app using Node.js PM2?

Spread the love

To pass execution arguments to app using Node.js PM2, we use the --

For instance, we run

pm2 start app.js -- --prod --second-arg --third-arg

to start app.js with start.

And then we pass in the arguments after --.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *