{"name":"inquirer-checkbox-plus-prompt","version":"1.1.0","description":"Checkbox with autocomplete and other additions for Inquirer","main":"index.js","repository":{"type":"git","url":"git+https://github.com/faressoft/inquirer-checkbox-plus-prompt.git"},"keywords":["inquirer","checkbox","autocomplete","search","filter","searchable","highlight","source","api","promise","command","prompt","stdin","cli","tty","menu"],"author":{"name":"Mohammad Fares","email":"faressoft.com@gmail.com"},"license":"MIT","dependencies":{"cli-cursor":"^2.1.0","figures":"^2.0.0","lodash":"^4.17.5"},"devDependencies":{"fuzzy":"^0.1.3"},"peerDependencies":{"inquirer":">=5.1.0"},"gitHead":"492e02f2c88150b9d7150e9ba8bc61aedb78c84d","bugs":{"url":"https://github.com/faressoft/inquirer-checkbox-plus-prompt/issues"},"homepage":"https://github.com/faressoft/inquirer-checkbox-plus-prompt#readme","_id":"inquirer-checkbox-plus-prompt@1.1.0","_nodeVersion":"14.19.0","_npmVersion":"6.14.16","dist":{"integrity":"sha512-m25K88tQEU9X0l5VO7ac/aFxTSONq7iHdRJv9WX9ktFW18kHKocEnAClXkHj1ZYzJ67kr3QoR1c0WWg2VXmzFw==","shasum":"06a1920a7a7160b5b227d77642aa21cb80eaa70b","tarball":"http://registry-npm.ywwl.com/inquirer-checkbox-plus-prompt/download/inquirer-checkbox-plus-prompt-1.1.0.tgz","fileCount":8,"unpackedSize":103681,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCX6prXcyoC2pCPiAvZQ/40dT4ihfeDNN4qtcdSON/UIQIhAOvHEskpzrJ7Uhu9hvi0BxRoTeSklUENnsN0sOnOlA0B"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjd+4DACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq0ww/7BJi1OqoPon1EsLMer11+aHlo7FfqsETH9LEEAtJ+V/J+6jU5\r\nBooROf6tOsRiIF4kewbjlSc/8OJ0AJj3yPBn8Fhg08j8ev1F3BQ882EfKBGD\r\nkaMqVGRJCM1+vEQ3J6rP1++CCfCwqlbP1SIbiV0LpIJHU6gUdJKElAUh4nkb\r\ntGONL/xOYB/f7PKhbe+r5E0j1+p5yjz2txNe166fQx78NTtEYTywfTTOKIzo\r\nueVdW3j8t3JRmKfLnVQoqAEbnMetUhc8bv4ooMTt7ZgSHlotwWPx3X8zDNam\r\nS2xOAUNZhM/lGFddss5TvVVvOrra8G41XRvW6quynDYmhWt57K4jwAO5jRUK\r\nALPkS2VshR6GeTml08bnYEuzD7xdJhiK+V7ADfHtb/irtq0oT/t8Jz5kbCR+\r\nFjm8kJ08W0BBOmthqhMQnCeQkdfBwCRwnldAHx73YDf/rE1mugbUyQ+w+iQ2\r\noGfaXUup2pYRQO59QpmXlNFrqav1OPvoGOWGdL69wtv9FziZiGRYoaMDMscT\r\naP1FkU9IFZKxIX5iX3IvUs/o3j6IORdRLn4IMGWnRvavvmwgtT8LfyvnlwRn\r\nT+P25WdLmMuuIVyDLIUNcUFiyy3UpCfuj8tmhD6D0j5mXxsuuRlnn0iQhpij\r\nhIzMMPrdh3Q+yzL2XzBq2vvHTNGBGyPIeTc=\r\n=p50S\r\n-----END PGP SIGNATURE-----\r\n","size":52925,"noattachment":false,"key":"/inquirer-checkbox-plus-prompt/-/inquirer-checkbox-plus-prompt-1.1.0.tgz"},"_npmUser":{"name":"faressoft","email":"faressoft.com@gmail.com"},"directories":{},"maintainers":[{"name":"faressoft","email":"faressoft.com@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/inquirer-checkbox-plus-prompt_1.1.0_1668804098891_0.43695185177354356"},"_hasShrinkwrap":false,"readme":"# Inquirer Checkbox Plus Prompt\n\nA plugin for [Inquirer](https://github.com/SBoudrias/Inquirer.js), similar to the original checkbox with extra features.\n\n[![npm](https://img.shields.io/npm/v/inquirer-checkbox-plus-prompt.svg)](https://www.npmjs.com/package/inquirer-checkbox-plus-prompt)\n[![npm](https://img.shields.io/npm/l/inquirer-checkbox-plus-prompt.svg)](https://github.com/faressoft/inquirer-checkbox-plus-prompt/blob/master/LICENSE)\n\n<p align=\"center\">\n  <img width=\"500\" src=\"/demo.gif?raw=true\">\n  <br>\n  <span>The animated GIF is made by <a href=\"https://github.com/faressoft/terminalizer\">Terminalizer</a></span>\n</p>\n\n# Installation\n\n```\nnpm install inquirer-checkbox-plus-prompt\n```\n\n# Usage\n\nYou can name it with any name other than `checkbox-plus`, just change the string `'checkbox-plus'` to anything else.\n\n```js\ninquirer.registerPrompt('checkbox-plus', require('inquirer-checkbox-plus-prompt'));\n\ninquirer.prompt({\n  type: 'checkbox-plus',\n  ...\n})\n```\n\n# Options\n\nTakes `type`, `name`, `message`, `source`[, `filter`, `validate`, `default`, `pageSize`, `highlight`, `searchable`] properties.\n\nThe extra options that this plugin provides are:\n\n* **source**: (Function) a method that called to return a promise that should be resolved with a list of choices in a similar format as the `choices` option in the original `checkbox` prompt of `Inquirer`.\n* **highlight**: (Boolean) if `true`, the current selected choice gets highlighted. Default: `false`.\n* **searchable**: (Boolean) if `true`, allow the user to filter the list. The `source` function gets called everytime the search query is changed. Default: `false`.\n\n# Example\n\nCheck [example.js](/example.js?raw=true) for a more advanced example.\n\n```js\nvar inquirer = require('inquirer');\nvar fuzzy = require('fuzzy');\n\ninquirer.registerPrompt('checkbox-plus', require('./index'));\n\nvar colors = ['red', 'green', 'blue', 'yellow'];\n\ninquirer.prompt([{\n  type: 'checkbox-plus',\n  name: 'colors',\n  message: 'Enter colors',\n  pageSize: 10,\n  highlight: true,\n  searchable: true,\n  default: ['yellow', 'red'],\n  source: function(answersSoFar, input) {\n\n    input = input || '';\n\n    return new Promise(function(resolve) {\n\n      var fuzzyResult = fuzzy.filter(input, colors);\n\n      var data = fuzzyResult.map(function(element) {\n        return element.original;\n      });\n\n      resolve(data);\n      \n    });\n\n  }\n}]).then(function(answers) {\n\n  console.log(answers.colors);\n\n});\n```\n\n# License\n\nThis project is under the MIT license.\n","publish_time":1668804099055,"_cnpm_publish_time":1668804099055,"dist-tags":{"latest":"1.4.2"}}