Skip to content

Commit 53ac405

Browse files
committed
chore: add opts.require docs
1 parent 82880f8 commit 53ac405

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

readme.md

+23
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,29 @@ When unspecified, `ley` assumes that your client driver is able to connect throu
252252
>**Note:** The `ley` CLI will search for a `ley.config.js` config file (configurable).<br>
253253
If found, this file may contain an object or a function that resolves to your config object.
254254
255+
#### opts.require
256+
Type: `string` or `string[]`<br>
257+
Default: `undefined`
258+
259+
A module name (or list of names) to be `require`d by `ley` at startup.
260+
261+
For example, you may want to use [`dotenv`](http://npmjs.com/package/dotenv) to load existing `.env` file(s) in your project:
262+
263+
```js
264+
const ley = require('ley');
265+
266+
const files = await ley.status({
267+
require: ['dotenv/config']
268+
});
269+
```
270+
271+
Through [CLI](#cli) usage, this is equivalent to:
272+
273+
```sh
274+
$ ley -r dotenv/config status
275+
# or
276+
$ ley --require dotenv/config status
277+
```
255278
256279
## License
257280

0 commit comments

Comments
 (0)