Simple usages of NODE_ENV
- No configuration
- Lightweight
- with npm
npm i cli-node-env
- with yarn
yarn add cli-node-env
- with pnpm
pnpm add cli-node-env
/* index.js */
// Use this package at the top of your entry file
// Esmodules
import 'cli-node-env'
// CommonJS modules
require('cli-node-env')
console.log(process.env.NODE_ENV)
// ...
node index.js --NODE_ENV=production
node index.js --NODE_ENV=development
node index.js --NODE_ENV=whatever
Made by Nazmus Sayad with ❤️.