@inquirer/demo 1.1.13 → 1.1.15

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.
@@ -19,7 +19,6 @@ const demo = async () => {
19
19
  answer = await search({
20
20
  message: 'Select an npm package',
21
21
  source: async (input = 'inquirer', { signal }) => {
22
- // eslint-disable-next-line n/no-unsupported-features/node-builtins
23
22
  const response = await fetch(`https://registry.npmjs.org/-/v1/search?text=${encodeURIComponent(input)}&size=20`, { signal });
24
23
  const data = (await response.json());
25
24
  return data.objects.map((pkg) => ({
@@ -1,5 +1,6 @@
1
1
  import * as url from 'node:url';
2
2
  import { select, Separator } from '@inquirer/prompts';
3
+ import colors from 'yoctocolors-cjs';
3
4
  const alphabet = [
4
5
  { value: 'A' },
5
6
  { value: 'B' },
@@ -66,6 +67,27 @@ const demo = async () => {
66
67
  loop: false,
67
68
  });
68
69
  console.log('Answer:', answer);
70
+ answer = await select({
71
+ message: 'Select a recipe',
72
+ choices: [
73
+ {
74
+ name: `${colors.bold('Spaghetti Carbonara')}\n Eggs, Pecorino Romano, Pancetta\n 30 minutes`,
75
+ short: 'Spaghetti Carbonara',
76
+ value: 'carbonara',
77
+ },
78
+ {
79
+ name: `${colors.bold('Margherita Pizza')}\n Tomatoes, Mozzarella, Basil\n 45 minutes`,
80
+ short: 'Margherita Pizza',
81
+ value: 'pizza',
82
+ },
83
+ {
84
+ name: `${colors.bold('Caesar Salad')}\n Romaine, Croutons, Parmesan\n 15 minutes`,
85
+ short: 'Caesar Salad',
86
+ value: 'salad',
87
+ },
88
+ ],
89
+ });
90
+ console.log('Answer:', answer);
69
91
  };
70
92
  if (import.meta.url.startsWith('file:')) {
71
93
  const modulePath = url.fileURLToPath(import.meta.url);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inquirer/demo",
3
- "version": "1.1.13",
3
+ "version": "1.1.15",
4
4
  "description": "Inquirer demos",
5
5
  "keywords": [
6
6
  "answer",
@@ -70,13 +70,13 @@
70
70
  "tsc": "tshy"
71
71
  },
72
72
  "dependencies": {
73
- "@inquirer/core": "^10.1.12",
73
+ "@inquirer/core": "^10.1.14",
74
74
  "@inquirer/figures": "^1.0.12",
75
- "@inquirer/prompts": "^7.5.2",
75
+ "@inquirer/prompts": "^7.6.0",
76
76
  "yoctocolors-cjs": "^2.1.2"
77
77
  },
78
78
  "devDependencies": {
79
- "@types/node": "^22.14.0",
79
+ "@types/node": "^24.0.1",
80
80
  "tshy": "^3.0.2"
81
81
  },
82
82
  "engines": {
@@ -105,5 +105,5 @@
105
105
  "optional": true
106
106
  }
107
107
  },
108
- "gitHead": "85d4642b4a7a2229ea60167fc7cc25fe6fea2f18"
108
+ "gitHead": "43b7bb94390c1e2b6473af1b790ff2fd1c8007c8"
109
109
  }