$ cnpm install envlint
Prerequisites: Node.js (>=8), npm version 3+.
There are two ways to install ENVLint: globally and locally.
If you want to include ENVLint as part of your project's build system, we recommend installing it locally. You can do so using npm:
$ npm install envlint --save-dev
You should then setup a configuration file using the format below. You can name it anything but we recommend .envlintrc
After that, you can run ENVLint on any file or directory like this:
$ ./node_modules/.bin/envlint yourfile.js
We don't currently recommend using envlint globally.
Your config file should look something like these below. JSON Format
{
"FEATURE_FLAG": {
"required": true,
"type": "number"
},
"COOKIE_SECRET": {
"required": true,
"type": "string",
"length": "8-12"
}
Comment format
# required, number
FEATURE_FLAG=
# required, string, length=8-12
COOKIE_SECRET
Each key in your .env can include the following fields:
required
- (optional) true
, false
type
- (optional) number
, string
, boolean
length
- (optional) a-b
, a
; where a and b are integersCopyright 2014 - 2017 © taobao.org |