config-check
Install
$ npm i config-check
Usage
const cc = const config = env: port: redis: uri: aws: secret: key: region: endpoint:
Methods
required()
Enforces env var existence
default(value)
Adds default value
int()
Enforces the value is an integer with casting
float()
Enforces the value is a float with casting
list(delimiter)
Splits a string into a list, not safe Default delimiter is ','
const delimiter = ' '
exec()
Returns the final value
Development
Requirements
- standardjs linting
- 100% test coverage
Npm run commands
Command | Description |
---|---|
lint | Checks project linting |
lint:fix | Auto fixes project lint errors |
test | Test runner |
test:watch | Test runner with watch |
coverage | Coverage checker |
changelog | Generate changelog |