{"name":"@inquirer/select","version":"4.0.0","description":"Inquirer select/list prompt","keywords":["answer","answers","ask","base","cli","command","command-line","confirm","enquirer","generate","generator","hyper","input","inquire","inquirer","interface","iterm","javascript","menu","node","nodejs","prompt","promptly","prompts","question","readline","scaffold","scaffolder","scaffolding","stdin","stdout","terminal","tty","ui","yeoman","yo","zsh"],"homepage":"https://github.com/SBoudrias/Inquirer.js/blob/main/packages/select/README.md","repository":{"type":"git","url":"https://github.com/SBoudrias/Inquirer.js.git"},"license":"MIT","author":"Simon Boudrias <admin@simonboudrias.com>","sideEffects":false,"type":"module","exports":{"./package.json":"./package.json",".":{"import":{"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.js"}}},"main":"./dist/commonjs/index.js","module":"./dist/esm/index.js","types":"./dist/commonjs/index.d.ts","scripts":{"attw":"attw --pack","tsc":"tshy"},"dependencies":{"@inquirer/core":"^10.0.0","@inquirer/figures":"^1.0.7","@inquirer/type":"^3.0.0","ansi-escapes":"^4.3.2","yoctocolors-cjs":"^2.1.2"},"devDependencies":{"@arethetypeswrong/cli":"^0.16.4","@inquirer/testing":"^2.1.35","@repo/tsconfig":"workspace:*","tshy":"^3.0.2"},"engines":{"node":">=18"},"publishConfig":{"access":"public"},"tshy":{"exclude":["src/**/*.test.ts"],"exports":{"./package.json":"./package.json",".":"./src/index.ts"}},"gitHead":"483189975eb5ea7d214c265a5ce108544c2bf1a5","_nodeVersion":"20.17.0","_npmVersion":"lerna/8.1.8/node@v20.17.0+arm64 (darwin)","_id":"@inquirer/select@4.0.0","dist":{"integrity":"sha512-XTN4AIFusWbNCBU1Xm2YDxbtH94e/FOrC27U3QargSsoDT1mRm+aLfqE+oOZnUuxwtTnInRT8UHRU3MVOu52wg==","shasum":"6b795e288319d9f3e3c471ac79b13f44592c3257","tarball":"http://registry-npm.ywwl.com/@inquirer/select/download/@inquirer/select-4.0.0.tgz","fileCount":9,"unpackedSize":22434,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC5kyqJfeYZXU2lACPgguiBBFxU/zg7/GNA2GCehZOb7wIgXHPQ2dyaGWjN3VANBJJYREfGVQqE4a5igRS1+U2KgIo="}],"size":5987,"noattachment":false,"key":"/@inquirer/select/-/@inquirer/select-4.0.0.tgz"},"_npmUser":{"name":"sboudrias","email":"admin@simonboudrias.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/select_4.0.0_1728247783969_0.3623261750888034"},"_hasShrinkwrap":false,"readme":"# `@inquirer/select`\n\nSimple interactive command line prompt to display a list of choices (single select.)\n\n![select prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/list.svg)\n\n# Installation\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/prompts\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/prompts\n```\n\n</td>\n</tr>\n<tr>\n<td colSpan=\"2\" align=\"center\">Or</td>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/select\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/select\n```\n\n</td>\n</tr>\n</table>\n\n# Usage\n\n```js\nimport { select, Separator } from '@inquirer/prompts';\n// Or\n// import select, { Separator } from '@inquirer/select';\n\nconst answer = await select({\n  message: 'Select a package manager',\n  choices: [\n    {\n      name: 'npm',\n      value: 'npm',\n      description: 'npm is the most popular package manager',\n    },\n    {\n      name: 'yarn',\n      value: 'yarn',\n      description: 'yarn is an awesome package manager',\n    },\n    new Separator(),\n    {\n      name: 'jspm',\n      value: 'jspm',\n      disabled: true,\n    },\n    {\n      name: 'pnpm',\n      value: 'pnpm',\n      disabled: '(pnpm is not available)',\n    },\n  ],\n});\n```\n\n## Options\n\n| Property | Type                    | Required | Description                                                                                                                                 |\n| -------- | ----------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------- |\n| message  | `string`                | yes      | The question to ask                                                                                                                         |\n| choices  | `Choice[]`              | yes      | List of the available choices.                                                                                                              |\n| default  | `string`                | no       | Defines in front of which item the cursor will initially appear. When omitted, the cursor will appear on the first selectable item.         |\n| pageSize | `number`                | no       | By default, lists of choice longer than 7 will be paginated. Use this option to control how many choices will appear on the screen at once. |\n| loop     | `boolean`               | no       | Defaults to `true`. When set to `false`, the cursor will be constrained to the top and bottom of the choice list without looping.           |\n| theme    | [See Theming](#Theming) | no       | Customize look of the prompt.                                                                                                               |\n\n`Separator` objects can be used in the `choices` array to render non-selectable lines in the choice list. By default it'll render a line, but you can provide the text as argument (`new Separator('-- Dependencies --')`). This option is often used to add labels to groups within long list of options.\n\n### `Choice` object\n\nThe `Choice` object is typed as\n\n```ts\ntype Choice<Value> = {\n  value: Value;\n  name?: string;\n  description?: string;\n  short?: string;\n  disabled?: boolean | string;\n};\n```\n\nHere's each property:\n\n- `value`: The value is what will be returned by `await select()`.\n- `name`: This is the string displayed in the choice list.\n- `description`: Option for a longer description string that'll appear under the list when the cursor highlight a given choice.\n- `short`: Once the prompt is done (press enter), we'll use `short` if defined to render next to the question. By default we'll use `name`.\n- `disabled`: Disallow the option from being selected. If `disabled` is a string, it'll be used as a help tip explaining why the choice isn't available.\n\n`choices` can also be an array of string, in which case the string will be used both as the `value` and the `name`.\n\n## Keybindings\n\nSet `INQUIRER_KEYBINDINGS=vim`, `INQUIRER_KEYBINDINGS=emacs`, or `INQUIRER_KEYBINDINGS=vim,emacs` to enable alternative navigation keybindings globally.\n\nWhen Vim keybindings are enabled, the prompt disables type-to-search so navigation keys are not interpreted as search input. You can override the environment setting per prompt with `theme.keybindings`.\n\n## Theming\n\nYou can theme a prompt by passing a `theme` object option. The theme object only need to includes the keys you wish to modify, we'll fallback on the defaults for the rest.\n\n```ts\ntype Theme = {\n  prefix: string | { idle: string; done: string };\n  spinner: {\n    interval: number;\n    frames: string[];\n  };\n  style: {\n    answer: (text: string) => string;\n    message: (text: string, status: 'idle' | 'done' | 'loading') => string;\n    error: (text: string) => string;\n    help: (text: string) => string;\n    highlight: (text: string) => string;\n    description: (text: string) => string;\n    disabled: (text: string) => string;\n    keysHelpTip: (keys: [key: string, action: string][]) => string | undefined;\n  };\n  icon: {\n    cursor: string;\n  };\n  indexMode: 'hidden' | 'number';\n  keybindings: readonly ('emacs' | 'vim')[];\n};\n```\n\n### `theme.style.keysHelpTip`\n\nThis function allows you to customize the keyboard shortcuts help tip displayed below the prompt. It receives an array of key-action pairs and should return a formatted string. You can also hook here to localize the labels to different languages.\n\nIt can also returns `undefined` to hide the help tip entirely.\n\n```js\ntheme: {\n  style: {\n    keysHelpTip: (keys) => {\n      // Return undefined to hide the help tip completely.\n      return undefined;\n\n      // Or customize the formatting. Or localize the labels.\n      return keys.map(([key, action]) => `${key}: ${action}`).join(' | ');\n    };\n  }\n}\n```\n\n### `theme.indexMode`\n\nControls how indices are displayed before each choice:\n\n- `hidden` (default): No indices are shown\n- `number`: Display a number before each choice (e.g. \"1. Option A\")\n\n# License\n\nCopyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n","publish_time":1728247784187,"maintainers":[{"name":"sboudrias","email":"admin@simonboudrias.com"},{"name":"danielchatfield","email":"chatfielddaniel@gmail.com"},{"name":"mischah","email":"mail@michael-kuehnel.de"}],"_cnpm_publish_time":1728247784187,"dist-tags":{"latest":"5.3.0"}}