{"id":15209518,"url":"https://github.com/th0r/inquirer-sortable-checkbox","last_synced_at":"2025-08-19T03:10:15.237Z","repository":{"id":236043327,"uuid":"791363104","full_name":"th0r/inquirer-sortable-checkbox","owner":"th0r","description":null,"archived":false,"fork":false,"pushed_at":"2024-04-26T13:58:17.000Z","size":26,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-09T14:24:53.558Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/th0r.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-24T15:26:49.000Z","updated_at":"2025-03-24T12:09:23.000Z","dependencies_parsed_at":"2024-04-25T12:34:10.333Z","dependency_job_id":"288216ed-4106-4e3c-b183-75d457829fa4","html_url":"https://github.com/th0r/inquirer-sortable-checkbox","commit_stats":null,"previous_names":["th0r/inquirer-sortable-checkbox"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/th0r/inquirer-sortable-checkbox","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/th0r%2Finquirer-sortable-checkbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/th0r%2Finquirer-sortable-checkbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/th0r%2Finquirer-sortable-checkbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/th0r%2Finquirer-sortable-checkbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/th0r","download_url":"https://codeload.github.com/th0r/inquirer-sortable-checkbox/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/th0r%2Finquirer-sortable-checkbox/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270932151,"owners_count":24670237,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-17T02:00:09.016Z","response_time":129,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-09-28T07:40:37.991Z","updated_at":"2025-08-19T03:10:15.208Z","avatar_url":"https://github.com/th0r.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"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\u003c{ value: any, name?: string, disabled?: boolean \\| string, checked?: boolean }\u003e` | 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\\[\\] =\u003e boolean \\| string \\| Promise\u003cstring \\| boolean\u003e`                         | 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) =\u003e string;\n    message: (text: string) =\u003e string;\n    error: (text: string) =\u003e string;\n    defaultAnswer: (text: string) =\u003e string;\n    help: (text: string) =\u003e string;\n    highlight: (text: string) =\u003e string;\n    key: (text: string) =\u003e string;\n    disabledChoice: (text: string) =\u003e string;\n    renderSelectedChoices: \u003cT\u003e(\n      selectedChoices: ReadonlyArray\u003cChoice\u003cT\u003e\u003e,\n      allChoices: ReadonlyArray\u003cChoice\u003cT\u003e | Separator\u003e,\n    ) =\u003e 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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fth0r%2Finquirer-sortable-checkbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fth0r%2Finquirer-sortable-checkbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fth0r%2Finquirer-sortable-checkbox/lists"}