You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/prompts/README.md
+8-8
Original file line number
Diff line number
Diff line change
@@ -123,7 +123,7 @@ s.stop('Installed via npm');
123
123
124
124
## Utilities
125
125
126
-
### Grouping
126
+
### Group
127
127
128
128
Grouping prompts together is a great way to keep your code organized. This accepts a JSON object with a name that can be used to reference the group later. The second argument is an optional but has a `onCancel` callback that will be called if the user cancels one of the prompts in the group.
129
129
@@ -157,18 +157,18 @@ const group = await p.group(
157
157
console.log(group.name, group.age, group.color);
158
158
```
159
159
160
-
### Building
160
+
### Workflow
161
161
162
-
Just like `group`, but on `builder` way, so you can choose which one fits better.
162
+
Just like `group`, but on builder way, so you can choose which one fits better.
163
163
164
164
```js
165
165
import*aspfrom'@clack/prompts';
166
166
167
167
constresults=await p
168
-
.builder()
169
-
.add('name', () =>p.text({ message:'What is your name?' }))
170
-
.add('age', () =>p.text({ message:'What is your age?' }))
171
-
.add('color', ({ results }) =>
168
+
.workflow()
169
+
.step('name', () =>p.text({ message:'What is your name?' }))
170
+
.step('age', () =>p.text({ message:'What is your age?' }))
171
+
.step('color', ({ results }) =>
172
172
p.multiselect({
173
173
message:`What is your favorite color ${results.name}?`,
0 commit comments