{"id":16226180,"url":"https://github.com/antony/unquirer","last_synced_at":"2025-08-23T13:35:37.817Z","repository":{"id":66169680,"uuid":"133386134","full_name":"antony/unquirer","owner":"antony","description":"A wrapper for Inquirer to allow pre-answering questions with command line arguments","archived":false,"fork":false,"pushed_at":"2018-05-14T20:34:30.000Z","size":41,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-08T03:45:32.468Z","etag":null,"topics":["cli","cli-app","inquirer","javascript","override","prompt","wrapper"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/antony.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":"2018-05-14T15:51:55.000Z","updated_at":"2019-05-04T06:23:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"0c02706e-3dbd-42e8-b0d5-e4aea2e1c438","html_url":"https://github.com/antony/unquirer","commit_stats":{"total_commits":7,"total_committers":1,"mean_commits":7.0,"dds":0.0,"last_synced_commit":"e32048d4cf0f468a1e2e5cf407ace707ece09c11"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/antony/unquirer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antony%2Funquirer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antony%2Funquirer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antony%2Funquirer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antony%2Funquirer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/antony","download_url":"https://codeload.github.com/antony/unquirer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antony%2Funquirer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271749059,"owners_count":24814115,"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-23T02:00:09.327Z","response_time":69,"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":["cli","cli-app","inquirer","javascript","override","prompt","wrapper"],"created_at":"2024-10-10T12:48:22.948Z","updated_at":"2025-08-23T13:35:37.785Z","avatar_url":"https://github.com/antony.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Unquirer\n\n[![Build Status](https://travis-ci.org/antony/unquirer.svg?branch=master)](https://travis-ci.org/antony/unquirer)\n\nA wrapper for [Inquirer](https://www.npmjs.com/package/inquirer) to allow pre-answering questions with command line arguments\n\n### Installation\n\nThis library has a peer dependency of inquirer, so make sure you also install it.\n\n```bash\n  npm install --save unquirer inquirer\n```\n\n### Usage\n\nGiven the following highly opinionated version of the inquirer 'input' example, to demonstrate `filter` and `validate` support:\n\n```javascript\n  const unquirer = require('unquirer')\n\n  var questions = [\n    {\n      type: 'input',\n      name: 'firstName',\n      message: \"What's your first name\"\n    },\n    {\n      type: 'input',\n      name: 'lastName',\n      message: \"What's your last name\",\n      filter: answer =\u003e {\n        return 'Smith'\n      }\n    },\n    {\n      type: 'input',\n      name: 'favColor',\n      message: \"What's your favorite color\",\n      validate: answer =\u003e {\n        if (answer === 'yellow') { return true }\n        return \"You can only like yellow!\"\n      }\n    }\n  ]\n\n  async function go () {\n    const answers = await unquirer.prompt(questions)\n    console.log(JSON.stringify(answers, null, '  '))\n  }\n\n  go()\n```\n\nYou could call this program in the regular way, to be prompted for all the questions:\n\n```bash\n  node input.js\n```\n\nOr, you could pass some of the answers in, and only be prompted about favColor:\n\n```bash\n  node input.js --firstName=\"Jim\" --lastName=\"Smith\"\n```\n\nOr you can pass in all the answers, totally non-interactive:\n\n```bash\n  node input.js --firstName=\"Jim\" --lastName=\"Smith\" --favColor=\"yellow\"\n```\n\n### Options\n\nOptions are passed as the second parameter to the `unquirer.prompt` method.\n\nThere is currently only one option, `useCamelCase`, which defaults to true. This pption causes parameters like `--some-param` to result in the answer key `someParam`. In order to preserve dashes in your `question` `name`s, pass `{ useCamelCase: false }` as options.\n\n### Validation\n\nValidation works the same as it does in Inquirer, i.e. in your validation method, return `true` to pass validation, return `false` to fail with a default message, and return any `string` to fail with that specific message.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantony%2Funquirer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fantony%2Funquirer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantony%2Funquirer/lists"}