Categories
JavaScript Answers

How to verify if Node.js instance is dev or production?

Spread the love

To verify if Node.js instance is dev or production, we get the NODE_ENV environment variable value.

For instance, we write

const env = process.env.NODE_ENV || "development";

to get the NODE_ENV environment variable value with process.env.NODE_ENV.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *