1.0.6 • Published 6 years ago
envatreactjs v1.0.6
envatreactjs
Run package.json scripts by NODE_ENV.
Installation
Install with npm:
npm install envatreactjsFeatures
- Read
NODE_ENVas environment variable fromprocess.env. - Read
NODE_ENVfrom .env file in your project root directory. - Defaults
NODE_ENVtodevelopment. - Customize
process.envfor 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 installorpnpm installoryarn install.npm startorpnpm startoryarn start.
Problem
Environments projects ReactJs .env
Solution
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*
Notes
by-node-env is essentially a clone of per-env with some notable fixes:
- .env (
NODE_ENVonly) 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