js application in npm scripts. For example, if 11-digit phone number format philippines you want to use node-env-run when you are in a development environment, but node when you are in production mode. To do this, use the if-env tool . Copy the code npm install if-env --save However, make sure you don't install it as a "development dependency" as we will need it in production as well.

Now edit your npm scripts in your package.json : JavaScript Copy the code "scripts": { "start": "if-env NODE_ENV=production ?? npm run start:prod || npm run start:dev", "start:dev": "nodenv -f .", "start:prod": "node ." } This script will now run npm run start:prod, then node. If NODE_ENV is set to production, it will run npm run start:dev, then nodenv -.