1.0.6 • Published 5 years ago

envatreactjs v1.0.6

Weekly downloads
3
License
ISC
Repository
github
Last release
5 years ago

envatreactjs

Run package.json scripts by NODE_ENV.

Installation

Install with npm:

npm install envatreactjs

Features

  • Read NODE_ENV as environment variable from process.env.
  • Read NODE_ENV from .env file in your project root directory.
  • Defaults NODE_ENV to development.
  • Customize process.env for each NODE_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:
    1. npm install or pnpm install or yarn install.
    2. npm start or pnpm start or yarn 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_ENV only) support.
    • pnpm compatibility.
    • Windows compatibility.
    • Yarn compatibility.
  • 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

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago