{"_rev":"3-b021f54f4d2969c40d2123533b3f84aa","time":{"created":"2024-04-26T13:58:56.615Z","1.0.0":"2024-04-25T12:07:39.627Z","modified":"2024-04-26T13:58:57.179Z","1.0.1":"2024-04-26T13:58:56.892Z"},"_id":"inquirer-sortable-checkbox","name":"inquirer-sortable-checkbox","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.1":{"name":"inquirer-sortable-checkbox","version":"1.0.1","engines":{"node":">=18"},"description":"Inquirer sortable checkbox prompt","main":"./dist/cjs/index.js","typings":"./dist/cjs/types/index.d.ts","repository":{"type":"git","url":"git+https://github.com/th0r/inquirer-sortable-checkbox.git"},"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","list","sortable","reorderable"],"author":{"name":"Yuriy Grunin","email":"grunin.ya@ya.ru"},"license":"MIT","homepage":"https://github.com/th0r/inquirer-sortable-checkbox","dependencies":{"@inquirer/core":"^8.0.1","@inquirer/figures":"^1.0.1","@inquirer/type":"^1.3.0","ansi-escapes":"^4.3.2","chalk":"^4.1.2"},"devDependencies":{"@sindresorhus/tsconfig":"^5.0.0","globby":"^14.0.1","prettier":"^3.2.5","ts-node":"^10.9.2","typescript":"^5.4.5"},"scripts":{"tsc":"npm run tsc:esm && npm run tsc:cjs","tsc:esm":"rm -rf dist/esm && tsc -p ./tsconfig.json","tsc:cjs":"rm -rf dist/cjs && tsc -p ./tsconfig.cjs.json && node ./tools/fix-ext.mjs","example":"node --no-warnings --loader ts-node/esm example.mts","prepare":"npm run tsc"},"publishConfig":{"access":"public"},"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"}}},"_id":"inquirer-sortable-checkbox@1.0.1","gitHead":"b2ef2a081364c36269fb2076a50ce58ddcc38893","bugs":{"url":"https://github.com/th0r/inquirer-sortable-checkbox/issues"},"_nodeVersion":"20.12.2","_npmVersion":"10.5.0","dist":{"integrity":"sha512-6uYqb5UZTa8Mz/pJ5yDom8d4trpcUHYsYlHGXpnUE/rzkJnhqZnKuu8EjJ+KBTK5+gxH/4jF8y5F2efvBTHs1Q==","shasum":"5658948407d0dad744811cd186a42d1b197fe570","tarball":"https://registry.npmjs.org/inquirer-sortable-checkbox/-/inquirer-sortable-checkbox-1.0.1.tgz","fileCount":6,"unpackedSize":26647,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF0/0kkanEOI/vYZAJ468ghwwDyNhbkqeLGFuR5LWh9JAiEAoslVPWBUrBHOR3TXqrXIYMCEdkqzQx0QaXa6dc/VevU="}]},"_npmUser":{"name":"th0r","email":"grunin.ya@ya.ru"},"directories":{},"maintainers":[{"name":"th0r","email":"grunin.ya@ya.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/inquirer-sortable-checkbox_1.0.1_1714139936715_0.9532861790386271"},"_hasShrinkwrap":false}},"maintainers":[{"name":"th0r","email":"grunin.ya@ya.ru"}],"description":"Inquirer sortable checkbox prompt","homepage":"https://github.com/th0r/inquirer-sortable-checkbox","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","list","sortable","reorderable"],"repository":{"type":"git","url":"git+https://github.com/th0r/inquirer-sortable-checkbox.git"},"author":{"name":"Yuriy Grunin","email":"grunin.ya@ya.ru"},"bugs":{"url":"https://github.com/th0r/inquirer-sortable-checkbox/issues"},"license":"MIT","readme":"# Sortable checkbox list for Inquirer.js\n\nSimple interactive command line prompt to display a sortable list of checkboxes (multi select).\n\n![Sortable checkbox prompt](https://github.com/th0r/inquirer-sortable-checkbox/assets/302213/08c0cbef-87fb-40be-ad6a-f07d4e60aff4)\n\n# Installation\n\n```sh\nnpm install inquirer-sortable-checkbox\n\nyarn add inquirer-sortable-checkbox\n```\n\n# Usage\n\n```js\nimport sortableCheckbox from 'inquirer-sortable-checkbox';\n\nconst answer = await sortableCheckbox({\n  message: 'Which PRs and in what order would you like to merge?',\n  choices: [\n    {\n      name: 'PR 1',\n      value: '#1',\n    },\n    {\n      name: 'PR 2',\n      value: '#2',\n      disabled: true,\n    },\n    {\n      name: 'PR 3',\n      value: '#3',\n      checked: true,\n    },\n  ],\n});\n```\n\n## Options\n\n| Property    | Type                                                                                    | Required | Description                                                                                                                                                                                           |\n|-------------|-----------------------------------------------------------------------------------------|----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| message     | `string`                                                                                | yes      | The question to ask                                                                                                                                                                                   |\n| choices     | `Array<{ value: any, name?: string, disabled?: boolean \\| string, checked?: boolean }>` | yes      | List of the available choices. The `value` will be returned as the answer, and used as display if no `name` is defined. Choices who're `disabled` will be displayed, but not selectable.              |\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| sortingLoop | `boolean`                                                                               | no       | Defaults to `false`. When set to `true`, moving first item up will move it to the end of the list, and moving last item down will move it to the start of the list.                                   |\n| required    | `boolean`                                                                               | no       | When set to `true`, ensures at least one choice must be selected.                                                                                                                                     |\n| validate    | `string\\[\\] => boolean \\| string \\| Promise<string \\| boolean>`                         | no       | On submit, validate the choices. When returning a string, it'll be used as the error message displayed to the user. Note: returning a rejected promise, we'll assume a code error happened and crash. |\n| theme       | [See Theming](#Theming)                                                                 | no       | Customize look of the prompt.                                                                                                                                                                         |\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;\n  spinner: {\n    interval: number;\n    frames: string[];\n  };\n  style: {\n    answer: (text: string) => string;\n    message: (text: string) => string;\n    error: (text: string) => string;\n    defaultAnswer: (text: string) => string;\n    help: (text: string) => string;\n    highlight: (text: string) => string;\n    key: (text: string) => string;\n    disabledChoice: (text: string) => string;\n    renderSelectedChoices: <T>(\n      selectedChoices: ReadonlyArray<Choice<T>>,\n      allChoices: ReadonlyArray<Choice<T> | Separator>,\n    ) => string;\n  };\n  icon: {\n    checked: string;\n    unchecked: string;\n    cursor: string;\n  };\n  helpMode: 'always' | 'never' | 'auto';\n};\n```\n\n### `theme.helpMode`\n\n- `auto` (default): Hide the help tips after an interaction occurs. The scroll tip will hide after any interactions, the selection and sorting tip will hide as soon as a first sorting is done.\n- `always`: The help tips will always show and never hide.\n- `never`: The help tips will never show.\n\n# License\n\nLicensed under the MIT license.\n","readmeFilename":"README.md"}