{"id":13447082,"url":"https://github.com/f/confirmation","last_synced_at":"2025-06-30T12:35:21.022Z","repository":{"id":45753417,"uuid":"172288351","full_name":"f/confirmation","owner":"f","description":"A simple Node tool to replicate Browser's confirm popup on your CLI.","archived":false,"fork":false,"pushed_at":"2019-02-24T22:30:22.000Z","size":4205,"stargazers_count":113,"open_issues_count":0,"forks_count":2,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-05-28T02:49:26.390Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/f.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":"2019-02-24T02:45:50.000Z","updated_at":"2025-02-11T15:50:54.000Z","dependencies_parsed_at":"2022-09-26T20:41:21.739Z","dependency_job_id":null,"html_url":"https://github.com/f/confirmation","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/f/confirmation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f%2Fconfirmation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f%2Fconfirmation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f%2Fconfirmation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f%2Fconfirmation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/f","download_url":"https://codeload.github.com/f/confirmation/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f%2Fconfirmation/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262774208,"owners_count":23362271,"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":[],"created_at":"2024-07-31T05:01:07.696Z","updated_at":"2025-06-30T12:35:20.992Z","avatar_url":"https://github.com/f.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# ⁉️ confirmation\n\nA simple Node tool to have Browser's `confirm` popup on your CLI.\n\n![confirmation](resources/demo.gif?v1)\n\n## Installation\n\n```\nyarn add confirmation\n```\n\n## Usage\n\nIn an `async` function just call `await confirmation`.\n\n```js\nif (await confirmation('Are you sure?')) {\n  console.log('Yay!');\n} else {\n  console.log('Oops!');\n}\n```\n\n![confirmation](resources/confirmation.png?v1)\n\n## API\n\n### `await confirmation(message) : bool`\n\nShows a message and `OK` and `Cancel` buttons.\n\n_Example_:\n```js\nconst result = await confirmation('You will delete your items, are you sure?')\n```\n\n### `await confirmation(title, message) : bool`\n\nShows a message with a title and `OK` and `Cancel` buttons.\n\n_Example_:\n```js\nconst result = await confirmation('Warning', 'You will delete your items, are you sure?')\n```\n\n### `await confirmation(title, message, ok, cancel) : bool`\n\nShows a message with a title and custom `OK` and custom `Cancel` buttons.\n\n_Example_:\n```js\nconst result = await confirmation(\n  'Warning',\n  'You will delete your items, are you sure?',\n  'I am sure',\n  'No!'\n)\n```\n\n## The Key bindings\n\nThe \u003ckbd\u003eY\u003c/kbd\u003e for **OK** and \u003ckbd\u003eN\u003c/kbd\u003e for **Cancel** are the default key bindings.\n\nWhen you customize your **OK** and **Cancel** buttons, the **first letter** will be the key binding. If you make **I am Sure** instead of **OK**, you'll need to press \u003ckbd\u003eI\u003c/kbd\u003e to confirm.\n\n### Example 1\n_Example_:\n```js\nconst result = await confirmation(\n  'Warning',\n  'You will delete your items, are you sure?',\n  '[O] OK',\n  '[X] Close'\n)\n```\nKeymap:\n- \u003ckbd\u003eO\u003c/kbd\u003e to Confirm\n- \u003ckbd\u003eX\u003c/kbd\u003e to Close\n\n### Example 2\n_Example_:\n```js\nconst result = await confirmation(\n  'Warnin\\'',\n  'Ye will scuttle yer items, are ye sure?',\n  'Aye',\n  'No'\n)\n```\nKeymap:\n- \u003ckbd\u003eA\u003c/kbd\u003e (_A_ye) to Confirm\n- \u003ckbd\u003eN\u003c/kbd\u003e (_N_o) to Close\n\n## License\nMIT \u0026copy; Fatih Kadir Akin\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ff%2Fconfirmation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ff%2Fconfirmation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ff%2Fconfirmation/lists"}