PM2 commands for managing and monitoring Node.js applications:
- Start an application:
Starts a Node.js app (
pm2 start app.js
app.js
), creating a managed process.
Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt
Create free AWS Account at https://aws.amazon.com/
I would be creating a t2.medium ubuntu machine for this demo.
1) Clone Repo | |
2) Install all module by `sudo npm install`. After installing all modules if u get any error run `npm rebuild` | |
2) Install pm2 by running `sudo npm i pm2 -g` | |
4) run via pm2 `pm2 start pm2-config.json` |
{ | |
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json", | |
"blocks": [ | |
{ | |
"alignment": "left", | |
"segments": [ | |
{ | |
"foreground": "#01F0FF", | |
"style": "plain", | |
"template": " {{ .UserName }} ", |
const array = [ | |
['a', ['m', 'n', 'o']], | |
['b', ['s', 't', 'u']], | |
['d', ['e', 'f', 'g']], | |
] | |
function getShortestPath(target, array){ | |
let shortest = array[0]; | |
let shortestDistance = Infinity; | |
for(let i = 0; i < array.length; i++){ |
const textToSpeech = (text) => { | |
const speech = new SpeechSynthesisUtterance(text); | |
[speech.voice] = speechSynthesis.getVoices(); | |
// sp.rate = ?; //speed of the voice. Default value is 1. lowest = 0.1 and highest = 10 | |
// sp.pitch = ?; //pitch of the voice. Default value is 1. lowest = 0 and highest = 2 | |
speechSynthesis.speak(speech); | |
}; | |
textToSpeech('Hello TalkJS!'); |