{"id":13447590,"url":"https://github.com/enquirer/prompt-grid","last_synced_at":"2025-04-10T12:33:17.094Z","repository":{"id":42187303,"uuid":"92480897","full_name":"enquirer/prompt-grid","owner":"enquirer","description":"Prompt that allows the user to re-arrange the cells in a grid in the terminal. This can be used for configuration for layouts, tables, HTML grids, etc.","archived":false,"fork":false,"pushed_at":"2017-05-26T15:16:22.000Z","size":61,"stargazers_count":7,"open_issues_count":1,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-03-25T19:59:29.405Z","etag":null,"topics":["command-line","enquirer","grid","prompt","prompts","question","terminal"],"latest_commit_sha":null,"homepage":"https://github.com/enquirer","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/enquirer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-26T06:48:09.000Z","updated_at":"2024-03-25T19:59:29.406Z","dependencies_parsed_at":"2022-09-14T15:51:58.223Z","dependency_job_id":null,"html_url":"https://github.com/enquirer/prompt-grid","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enquirer%2Fprompt-grid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enquirer%2Fprompt-grid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enquirer%2Fprompt-grid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enquirer%2Fprompt-grid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/enquirer","download_url":"https://codeload.github.com/enquirer/prompt-grid/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248217131,"owners_count":21066633,"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","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":["command-line","enquirer","grid","prompt","prompts","question","terminal"],"created_at":"2024-07-31T05:01:21.839Z","updated_at":"2025-04-10T12:33:17.073Z","avatar_url":"https://github.com/enquirer.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# prompt-grid [![NPM version](https://img.shields.io/npm/v/prompt-grid.svg?style=flat)](https://www.npmjs.com/package/prompt-grid) [![NPM monthly downloads](https://img.shields.io/npm/dm/prompt-grid.svg?style=flat)](https://npmjs.org/package/prompt-grid) [![NPM total downloads](https://img.shields.io/npm/dt/prompt-grid.svg?style=flat)](https://npmjs.org/package/prompt-grid)\n\n\u003e Prompt that allows the user to re-arrange the cells in a grid in the terminal.\n\n![prompt-grid example](https://raw.githubusercontent.com/enquirer/prompt-grid/master/example.gif)\n\nIf you like this project please consider starring it.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save prompt-grid\n```\n\n## Usage\n\nPass an array of choices to create a grid:\n\n```js\nvar Prompt = require('./');\nvar prompt = new Prompt({\n  name: 'letters',\n  message: 'Re-order cells',\n  choices: ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I']\n});\n\n// run as async\nprompt.ask(function(answer) {\n  console.log(answer);\n});\n\n// run as promise\nprompt.run()\n  .then(function(answer) {\n    console.log(answer);\n  });\n```\n\n## Enquirer usage\n\nRegister the prompt as a plugin with [enquirer](https://github.com/enquirer/enquirer):\n\n```js\nvar Enquirer = require('enquirer');\nvar enquirer = new Enquirer();\n\nenquirer.register('readme', require('prompt-grid'));\n```\n\n### Enquirer example\n\n[Enquirer](https://github.com/enquirer/enquirer) supports either the declarative object-oriented (inquirer-style) question format or a more expressive format using the `.question` method.\n\n**Declarative**\n\nInquirer-style declarative format (takes an array or object):\n\n```js\nvar questions = [\n  {\n    name: 'letters',\n    type: 'grid',\n    message: 'Hold shift+(up|right|down|left) to re-arrange cells',\n    choices: ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I']\n  }\n];\n\nenquirer.ask(questions)\n  .then(function(answers) {\n    console.log(answers)\n  });\n```\n\n**Expressive**\n\nPre-define questions and easily compose prompts by passing the name(s) of the prompts to run:\n\n```js\nenquirer.question('letters', {\n  type: 'grid',\n  message: 'Hold shift+(up|right|down|left) to re-arrange cells',\n  choices: ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I']\n});\n\nenquirer\n  .prompt(['letters'])\n  .then(function(answers) {\n    console.log(answers)\n  });\n```\n\n## About\n\n### Related projects\n\n* [prompt-base](https://www.npmjs.com/package/prompt-base): Base prompt module used for creating custom prompts. | [homepage](https://github.com/enquirer/prompt-base \"Base prompt module used for creating custom prompts.\")\n* [prompt-checkbox](https://www.npmjs.com/package/prompt-checkbox): Multiple-choice/checkbox prompt. Can be used standalone or with a prompt system like [Enquirer](https://github.com/enquirer/enquirer). | [homepage](https://github.com/enquirer/prompt-checkbox \"Multiple-choice/checkbox prompt. Can be used standalone or with a prompt system like [Enquirer].\")\n* [prompt-password](https://www.npmjs.com/package/prompt-password): Password prompt. Can be used as a standalone prompt, or with a prompt system like… [more](https://github.com/enquirer/prompt-password) | [homepage](https://github.com/enquirer/prompt-password \"Password prompt. Can be used as a standalone prompt, or with a prompt system like [Enquirer].\")\n* [prompt-sort](https://www.npmjs.com/package/prompt-sort): Prompt that allows the user to re-order items in a list of choices. | [homepage](https://github.com/enquirer/prompt-sort \"Prompt that allows the user to re-order items in a list of choices.\")\n\n### Contributing\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\n### Running tests\n\nRunning and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:\n\n```sh\n$ npm install \u0026\u0026 npm test\n```\n\n### Author\n\n**Brian Woodward**\n\n* [github/doowb](https://github.com/doowb)\n* [twitter/doowb](https://twitter.com/doowb)\n\n### License\n\nCopyright © 2017, [Brian Woodward](https://github.com/doowb).\nReleased under the [MIT License](LICENSE).\n\n***\n\n_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on May 26, 2017._","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenquirer%2Fprompt-grid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fenquirer%2Fprompt-grid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenquirer%2Fprompt-grid/lists"}