{"name":"@inquirer/rawlist","version":"2.2.3","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"],"author":"Simon Boudrias <admin@simonboudrias.com>","license":"MIT","_id":"@inquirer/rawlist@2.2.3","homepage":"https://github.com/SBoudrias/Inquirer.js/blob/main/packages/rawlist/README.md","dist":{"shasum":"8ce1b9857dd837434b72093855ee36881ee8ae5f","tarball":"http://registry-npm.ywwl.com/@inquirer/rawlist/download/@inquirer/rawlist-2.2.3.tgz","fileCount":8,"integrity":"sha512-qEqDLgCJ5jIJVAo1BpJBmqJunX6HDlhbQFMsufMH2/v3T4IeNCXTGgDG0xu7qwaPfw92c1VMP64BSQJYYvKoPA==","signatures":[{"sig":"MEYCIQDP6sokyGmi5HMSM6Cp7reL7yVWDkfRgWlvrurBuXjTRAIhAMAPdQBuZGdA/vIMcHLNtcpeEQmCtnUqTsRB1nkObCOc","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":12830,"size":4184,"noattachment":false,"key":"/@inquirer/rawlist/-/@inquirer/rawlist-2.2.3.tgz"},"main":"./dist/cjs/index.js","engines":{"node":">=18"},"exports":{".":{"import":{"types":"./dist/esm/types/index.d.mts","default":"./dist/esm/index.mjs"},"require":{"types":"./dist/cjs/types/index.d.ts","default":"./dist/cjs/index.js"}}},"gitHead":"056e26aa6497e0036864d032f9eb8d821de821e7","scripts":{"tsc":"yarn run tsc:esm && yarn run tsc:cjs","attw":"attw --pack","tsc:cjs":"rm -rf dist/cjs && tsc -p ./tsconfig.cjs.json && node ../../tools/fix-ext.mjs","tsc:esm":"rm -rf dist/esm && tsc -p ./tsconfig.json"},"typings":"./dist/cjs/types/index.d.ts","_npmUser":{"name":"sboudrias","email":"admin@simonboudrias.com"},"repository":{"url":"https://github.com/SBoudrias/Inquirer.js.git","type":"git"},"_npmVersion":"lerna/8.1.7/node@v20.11.1+arm64 (darwin)","description":"Inquirer rawlist prompt","directories":{},"sideEffects":false,"_nodeVersion":"20.11.1","dependencies":{"@inquirer/core":"^9.0.9","@inquirer/type":"^1.5.2","yoctocolors-cjs":"^2.1.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@inquirer/testing":"^2.1.31"},"_npmOperationalInternal":{"tmp":"tmp/rawlist_2.2.3_1722810079568_0.6008816254308882","host":"s3://npm-registry-packages"},"readme":"# `@inquirer/rawlist`\n\nSimple interactive command line prompt to display a raw list of choices (single value select) with minimal interaction.\n\n![rawlist prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/rawlist.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/rawlist\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/rawlist\n```\n\n</td>\n</tr>\n</table>\n\n# Usage\n\n```js\nimport { rawlist } from '@inquirer/prompts';\n// Or\n// import rawlist from '@inquirer/rawlist';\n\nconst answer = await rawlist({\n  message: 'Select a package manager',\n  choices: [\n    { name: 'npm', value: 'npm' },\n    { name: 'yarn', value: 'yarn' },\n    { name: 'pnpm', value: 'pnpm' },\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| 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| default  | `Value`                 | no       | The value of the choice to preselect. If the value is not found, no choice is preselected.                                        |\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  short?: string;\n  key?: string;\n  description?: string;\n};\n```\n\nHere's each property:\n\n- `value`: The value is what will be returned by `await rawlist()`.\n- `name`: This is the string displayed in the choice list.\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- `key`: The key of the choice. Displayed as `key) name`.\n- `description`: Option description which appears below the list when the choice is selected.\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\nYou 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    highlight: (text: string) => string;\n    description: (text: string) => string;\n  };\n  keybindings: readonly ('emacs' | 'vim')[];\n};\n```\n\n# License\n\nCopyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n","publish_time":1722810079755,"maintainers":[{"name":"sboudrias","email":"admin@simonboudrias.com"},{"name":"danielchatfield","email":"chatfielddaniel@gmail.com"},{"name":"mischah","email":"mail@michael-kuehnel.de"}],"_cnpm_publish_time":1722810079755,"dist-tags":{"latest":"5.4.0"}}