Run package.json scripts by NODE_ENV
.
Install with npm:
npm install envatreactjs
- Read
NODE_ENV
as environment variable fromprocess.env
. - Read
NODE_ENV
from .env file in your project root directory. - Defaults
NODE_ENV
todevelopment
. - Customize
process.env
for eachNODE_ENV
. - Clearer, concise scripts in package.json.
- No more Bash scripting in package.json.
- Works on Linux, macOS, and Windows.
- Compatible with npm, pnpm, and Yarn.
- Consistent workflow for any
NODE_ENV
:npm install
orpnpm install
oryarn install
.npm start
orpnpm start
oryarn start
.
Environments projects ReactJs .env
Install envatreactjs. Create .env Write variables at file .env with 'APP_' before variables
Ex: APP_HOST=localhost, APP_SECURE_KEY=fLNA&OFB#OF#OVB@VB*
-
by-node-env is essentially a clone of per-env with some notable fixes:
- .env (
NODE_ENV
only) support. - pnpm compatibility.
- Windows compatibility.
- Yarn compatibility.
- .env (
-
The .env file is parsed using dotenv.
-
This package might support more .env files in the future, as documented by create-react-app here.
-
Option to specify a custom file path for the .env file is not yet implemented, please raise an issue or PR if you need this feature.
Contact André Braga dnk_vip@hotmail.com