0
0
Node.jsframework~5 mins

PM2 for process management in Node.js - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is PM2 in Node.js?
PM2 is a process manager for Node.js applications that helps keep apps alive, reload them without downtime, and manage logs easily.
Click to reveal answer
beginner
How do you start an app with PM2?
Use the command pm2 start app.js to launch your Node.js app with PM2 managing it.
Click to reveal answer
beginner
What command shows the list of running processes in PM2?
Use pm2 list to see all apps PM2 is managing, their status, and resource use.
Click to reveal answer
intermediate
How does PM2 help with zero downtime reloads?
PM2 can reload apps gracefully using pm2 reload app_name, restarting processes without stopping service.
Click to reveal answer
intermediate
What is the purpose of the ecosystem.config.js file in PM2?
It is a config file where you define app settings, environment variables, and multiple app processes for PM2 to manage.
Click to reveal answer
Which PM2 command starts a Node.js app?
Apm2 start app.js
Bpm2 run app.js
Cpm2 launch app.js
Dpm2 execute app.js
How can you view all running processes managed by PM2?
Apm2 show
Bpm2 list
Cpm2 status
Dpm2 ps
What does pm2 reload app_name do?
AReloads the app without downtime
BRestarts the app with downtime
CStops the app immediately
DDeletes the app from PM2
Which file is used to configure multiple apps in PM2?
Apm2.config.js
Bpm2.json
Cecosystem.config.js
Dapp.config.js
What is one main benefit of using PM2?
ACompiling JavaScript
BWriting code faster
CCreating UI components
DManaging app processes and keeping them alive
Explain how PM2 helps keep a Node.js app running smoothly in production.
Think about what happens if your app crashes or needs updating.
You got /4 concepts.
    Describe the steps to start, monitor, and reload a Node.js app using PM2.
    Consider the basic PM2 commands for app lifecycle.
    You got /3 concepts.