Posted on September 15, 2019 at 2:45 pm
You can use the Node package named Forever to run continuously a NodeJs script. The advantage of using “forever” package is that it can make a NodeJs script execute forever even after the node script process is killed, because it gets respawned!
1) Install Node “forever” package
npm install forever -g |
2) Continuously start your NdoeJs script:
forever start /path/to/server.js |
3) To check if your NodeJs script is running use:
ps -ef | grep "/path/to/server.js" |
4) To stop the NodeJs script just use:
forever stop /path/to/server.js |
Updated on September 17, 2019 at 1:39 pm
Other Posts
- Detect VMWare Virtual Machine
- Detect Microsoft Virtual PC Virtual Machine
- Fix MariaDB 10.5 "Can't create test file" errors
- Use MariaDB and MySQL without Password (MySQL Backup)
- Check if a Trademark is already registered
- Make name server address permanent in /etc/resolv.conf
- InnoSetup error the servicemanager is not available
- InnoSetup disable DesktopIcon via command-line
Updated Posts
- Delphi 10 Berlin System.Hash MD5 SHA1 SHA2 Hash
- Use cURL to check for SSL certificate issues:
- How to test Socks5 proxy with cURL
- How to use variables in a sed command
- Best Socks5 Servers for Linux Debian
- Error NO_PUBKEY in Google Cloud Debian Packages Update
- How to Run a Command with Time Limit in Bash Linux
- MySQL InnoDB log sequence number is in the future