0.3.0 • Published 1 year ago

next-env-cmd v0.3.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

next-env-cmd

CLI command for loading .env files using @next/env and spawn process using cross-spawn modules.

Note: This is a standalone command and can be used without installing Next.js framework.

Install

$ npm install next-env-cmd

Usage

Use Next.js Environment Variables filename format.

/.env
/.env.development
/.env.development.local
/.env.test
/.env.test.local

And then in package.json.

{
  "script": {
    // defaults to load development env vars
    "dev": "next-env-cmd node start.js",
    // load production env vars in home directory
    "start": "NODE_ENV=production next-env-cmd -d ~/ node start.js",
    // load test env vars for testing (using alias "nexenv")
    "test": "NODE_ENV=test nexenv jest"
  }
}

Additional command options.

Usage: next-env-cmd [options] <command> [...args]

Examples:
  $ next-env-cmd node start.js          # load .env files in CWD
  $ next-env-cmd -d ~/ node start.js    # load .env files in ~/
  $ nexenv -p ../ node start.js         # alias shorthand command

Options:
  -v, --version        output the version number
  -d, --dir [path]     Custom env directory path (default: "./")
  -p, --parent [path]  Parent env directory path to be merged as defaults
  -h, --help           display help for command

License

MIT

0.3.0

1 year ago

0.2.2

1 year ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago