- Keeps your Node.js application running continuously.
- Ensure high availability and reliability of your application.
- Monitor and manage multiple processes with ease.
- Simplify the deployment process.
You can use PM2 with Bun in two ways: as a CLI option or in a configuration file.
With --interpreter
To start your application with PM2 and Bun as the interpreter, open your terminal and run the following command:
terminal
With a configuration file
Alternatively, you can create a PM2 configuration file. Create a file namedpm2.config.js
in your project directory and add the following content.
pm2.config.js
After saving the file, you can start your application with PM2
terminal
That’s it! Your JavaScript/TypeScript web server is now running as a daemon with PM2 using Bun as the interpreter.