Skip to content

Commit

Permalink
Add doc about second argument of convict (#348)
Browse files Browse the repository at this point in the history
  • Loading branch information
A-312 authored and madarche committed Mar 6, 2020
1 parent 0e48220 commit 051dd99
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/convict/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -383,11 +383,17 @@ convict.addParser({extension: 'json', parse: require('json5').parse});

## API

### var config = convict(schema)
### var config = convict(schema[, opts])

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

**opts:** Optional object:

- **opts.env**: Override `process.env` if specified using an object `{'NODE_ENV': 'production'}`.
- **opts.args**: Override `process.argv` if specified using an array `['--argname', 'value']` or
a string `--argname value`.

The configuration object has an API for getting and setting values, described
below.

Expand Down

0 comments on commit 051dd99

Please sign in to comment.