Skip to content

Commit 82880f8

Browse files
committed
chore: dedupe README options
1 parent 70f9c93 commit 82880f8

File tree

1 file changed

+29
-85
lines changed

1 file changed

+29
-85
lines changed

readme.md

+29-85
Original file line numberDiff line numberDiff line change
@@ -150,46 +150,14 @@ const successes = await ley.up({ ... });
150150
151151
## API
152152
153+
> **Important:** See [Options](#options) for common options shared all commands. <br>In this `API` section, you will only find **command-specific** options listed.
154+
155+
153156
### ley.up(opts?)
154157
Returns: `Promise<string[]>`
155158
156159
Returns a list of the _relative filenames_ (eg, `000-users.js`) that were successfully applied.
157160
158-
#### opts.cwd
159-
Type: `string`<br>
160-
Default: `.`
161-
162-
A target location to treat as the current working directory.
163-
164-
> **Note:** This value is `path.resolve()`d from the current `process.cwd()` location.
165-
166-
#### opts.dir
167-
Type: `string`<br>
168-
Default: `migrations`
169-
170-
The directory (relative to `opts.cwd`) to find migration files.
171-
172-
#### opts.client
173-
Type: `string`<br>
174-
Default: `undefined`
175-
176-
The **name** of your desired client driver; for example, `pg`.<br>
177-
When unspecified, `ley` searches for all supported client drivers in this order:
178-
179-
```js
180-
['postgres', 'pg']; // TODO: more
181-
```
182-
183-
#### opts.config
184-
Type: `object`<br>
185-
Default: `undefined`
186-
187-
A configuration object for your client driver to establish a connection.<br>
188-
When unspecified, `ley` assumes that your client driver is able to connect through `process.env` variables.
189-
190-
>**Note:** The `ley` CLI will search for a `ley.config.js` config file (configurable).<br>
191-
If found, this file may contain an object or a function that resolves to your config object.
192-
193161
#### opts.single
194162
Type: `boolean`<br>
195163
Default: `false`
@@ -204,31 +172,6 @@ Returns: `Promise<string[]>`
204172

205173
Returns a list of the _relative filenames_ (eg, `000-users.js`) that were successfully applied.
206174

207-
#### opts.cwd
208-
Type: `string`<br>
209-
Default: `.`
210-
211-
A target location to treat as the current working directory.
212-
213-
> **Note:** This value is `path.resolve()`d from the current `process.cwd()` location.
214-
215-
#### opts.dir
216-
Type: `string`<br>
217-
Default: `migrations`
218-
219-
The directory (relative to `opts.cwd`) to find migration files.
220-
221-
#### opts.client
222-
Type: `string`<br>
223-
Default: `undefined`
224-
225-
The **name** of your desired client driver; for example, `pg`.<br>
226-
When unspecified, `ley` searches for all supported client drivers in this order:
227-
228-
```js
229-
['postgres', 'pg']; // TODO: more
230-
```
231-
232175
#### opts.all
233176
Type: `boolean`<br>
234177
Default: `false`
@@ -242,31 +185,6 @@ Returns: `Promise<string[]>`
242185
243186
Returns a list of the _relative filenames_ (eg, `000-users.js`) that have not yet been applied.
244187
245-
#### opts.cwd
246-
Type: `string`<br>
247-
Default: `.`
248-
249-
A target location to treat as the current working directory.
250-
251-
> **Note:** This value is `path.resolve()`d from the current `process.cwd()` location.
252-
253-
#### opts.dir
254-
Type: `string`<br>
255-
Default: `migrations`
256-
257-
The directory (relative to `opts.cwd`) to find migration files.
258-
259-
#### opts.client
260-
Type: `string`<br>
261-
Default: `undefined`
262-
263-
The **name** of your desired client driver; for example, `pg`.<br>
264-
When unspecified, `ley` searches for all supported client drivers in this order:
265-
266-
```js
267-
['postgres', 'pg']; // TODO: more
268-
```
269-
270188
271189
### ley.new(opts?)
272190
Returns: `Promise<string>`
@@ -294,6 +212,11 @@ Default: `5`
294212
When **not** using a timestamped prefix, this value controls the prefix total length.<br>
295213
For example, `00000-users.js` will be followed by `00001-teams.js`.
296214
215+
216+
## Options
217+
218+
> **Note:** These are available to _all_ `ley` commands. <br>_See [API](#api) for programmatic command documentation._
219+
297220
#### opts.cwd
298221
Type: `string`<br>
299222
Default: `.`
@@ -308,6 +231,27 @@ Default: `migrations`
308231
309232
The directory (relative to `opts.cwd`) to find migration files.
310233
234+
#### opts.client
235+
Type: `string`<br>
236+
Default: `undefined`
237+
238+
The **name** of your desired client driver; for example, `pg`.<br>
239+
When unspecified, `ley` searches for all supported client drivers in this order:
240+
241+
```js
242+
['postgres', 'pg']; // TODO: more
243+
```
244+
245+
#### opts.config
246+
Type: `object`<br>
247+
Default: `undefined`
248+
249+
A configuration object for your client driver to establish a connection.<br>
250+
When unspecified, `ley` assumes that your client driver is able to connect through `process.env` variables.
251+
252+
>**Note:** The `ley` CLI will search for a `ley.config.js` config file (configurable).<br>
253+
If found, this file may contain an object or a function that resolves to your config object.
254+
311255
312256
## License
313257

0 commit comments

Comments
 (0)