TIL: Node doesn't have environments
—
til
We all are familiar with different types of environments where our application is run:
- Development
- Testing
- Staging
- Production
People in Node use NODE_ENV environment variable to set/get the environment. But, as mentioned on the official getting started guide,
There is no difference between development and production in Node.js
Libraries use of NODE_ENV is purely conventional.
But, if you want to use NODE_ENV then the only possible value it can have is production.
setting NODE_ENV to anything but production is considered an antipattern.
Refer the Node.js, the difference between development and production for the exact details.