@inquirer/prompts 7.3.3 → 7.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +2 -14
  2. package/package.json +12 -12
package/README.md CHANGED
@@ -192,7 +192,7 @@ const allowEmail = await confirm(
192
192
 
193
193
  ## Canceling prompt
194
194
 
195
- This can preferably be done with either an `AbortController` or `AbortSignal`.
195
+ This can be done with either an `AbortController` or `AbortSignal`.
196
196
 
197
197
  ```js
198
198
  // Example 1: using built-in AbortSignal utilities
@@ -202,7 +202,7 @@ const answer = await confirm({ ... }, { signal: AbortSignal.timeout(5000) });
202
202
  ```
203
203
 
204
204
  ```js
205
- // Example 1: implementing custom cancellation logic
205
+ // Example 2: implementing custom cancellation with an AbortController
206
206
  import { confirm } from '@inquirer/prompts';
207
207
 
208
208
  const controller = new AbortController();
@@ -213,18 +213,6 @@ setTimeout(() => {
213
213
  const answer = await confirm({ ... }, { signal: controller.signal });
214
214
  ```
215
215
 
216
- Alternatively, all prompt functions are returning a cancelable promise. This special promise type has a `cancel` method that'll cancel and cleanup the prompt.
217
-
218
- On calling `cancel`, the answer promise will become rejected.
219
-
220
- ```js
221
- import { confirm } from '@inquirer/prompts';
222
-
223
- const promise = confirm(...); // Warning: for this pattern to work, `await` cannot be used.
224
-
225
- promise.cancel();
226
- ```
227
-
228
216
  # Recipes
229
217
 
230
218
  ## Handling `ctrl+c` gracefully
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inquirer/prompts",
3
- "version": "7.3.3",
3
+ "version": "7.4.0",
4
4
  "description": "Inquirer prompts, combined in a single package",
5
5
  "keywords": [
6
6
  "answer",
@@ -76,16 +76,16 @@
76
76
  "tsc": "tshy"
77
77
  },
78
78
  "dependencies": {
79
- "@inquirer/checkbox": "^4.1.3",
80
- "@inquirer/confirm": "^5.1.7",
81
- "@inquirer/editor": "^4.2.8",
82
- "@inquirer/expand": "^4.0.10",
83
- "@inquirer/input": "^4.1.7",
84
- "@inquirer/number": "^3.0.10",
85
- "@inquirer/password": "^4.0.10",
86
- "@inquirer/rawlist": "^4.0.10",
87
- "@inquirer/search": "^3.0.10",
88
- "@inquirer/select": "^4.0.10"
79
+ "@inquirer/checkbox": "^4.1.4",
80
+ "@inquirer/confirm": "^5.1.8",
81
+ "@inquirer/editor": "^4.2.9",
82
+ "@inquirer/expand": "^4.0.11",
83
+ "@inquirer/input": "^4.1.8",
84
+ "@inquirer/number": "^3.0.11",
85
+ "@inquirer/password": "^4.0.11",
86
+ "@inquirer/rawlist": "^4.0.11",
87
+ "@inquirer/search": "^3.0.11",
88
+ "@inquirer/select": "^4.1.0"
89
89
  },
90
90
  "devDependencies": {
91
91
  "@arethetypeswrong/cli": "^0.17.4",
@@ -113,5 +113,5 @@
113
113
  "optional": true
114
114
  }
115
115
  },
116
- "gitHead": "79a0b3e7446b4a3de09445bf2f4031e4190b6382"
116
+ "gitHead": "83508f90ca65d26abc1408e4209e4f8fc73e43fe"
117
117
  }