Javascript: Difference between revisions

From My Mnemonic Rhyme
Jump to navigation Jump to search
 
Line 20: Line 20:
pm2 list
pm2 list
pm2 start "npm run dev" --name myAppName
pm2 start "npm run dev" --name myAppName
</pre>
===== pm2 examples =====
- Start and add a process to the pm2 process list:
<pre>
pm2 start app.js --name app
</pre>
- Show the process list:
<pre>
pm2 ls
</pre>
- Stop and delete a process from the pm2 process list:
<pre>
pm2 delete app
<pre>
- Stop, start and restart a process from the process list:
<pre>
pm2 stop app
pm2 start app
pm2 restart app
</pre>
- Clusterize an app to all CPU cores available:
<pre>
pm2 start -i max
</pre>
- Update pm2 :
<pre>
npm install pm2 -g && pm2 update
</pre>
- Install pm2 auto completion:
<pre>
pm2 completion install
</pre>
</pre>

Latest revision as of 22:38, 25 November 2023

Node

Install npx globally

nvm i -g npx
nvm ls-remote
nvm ls
nvm use v16.16.0

React

npx create-react-app my-app

pm2 - Run NPM as a service

pm2 list
pm2 start "npm run dev" --name myAppName
pm2 examples

- Start and add a process to the pm2 process list:

pm2 start app.js --name app

- Show the process list:

pm2 ls

- Stop and delete a process from the pm2 process list:

pm2 delete app
<pre>

- Stop, start and restart a process from the process list:
<pre>
pm2 stop app
pm2 start app
pm2 restart app

- Clusterize an app to all CPU cores available:

pm2 start -i max

- Update pm2 :

npm install pm2 -g && pm2 update

- Install pm2 auto completion:

pm2 completion install