envatreactjs

1.0.6 • Public • Published

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

Package Sidebar

Install

npm i envatreactjs

Weekly Downloads

0

Version

1.0.6

License

ISC

Unpacked Size

4.99 kB

Total Files

5

Last publish

Collaborators

  • andrelbraga