Skip to content

Commit 7064166

Browse files
authored
Add doc about second argument of convict (#348)
1 parent 5dda475 commit 7064166

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

packages/convict/README.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -383,11 +383,17 @@ convict.addParser({extension: 'json', parse: require('json5').parse});
383383

384384
## API
385385

386-
### var config = convict(schema)
386+
### var config = convict(schema[, opts])
387387

388388
`convict()` takes a schema object or a path to a schema JSON file and returns a
389389
convict configuration object.
390390

391+
**opts:** Optional object:
392+
393+
- **opts.env**: Override `process.env` if specified using an object `{'NODE_ENV': 'production'}`.
394+
- **opts.args**: Override `process.argv` if specified using an array `['--argname', 'value']` or
395+
a string `--argname value`.
396+
391397
The configuration object has an API for getting and setting values, described
392398
below.
393399

0 commit comments

Comments
 (0)