{"name":"inquirer-checkbox-plus-prompt","version":"1.0.1","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","inquirer":"^5.1.0","lodash":"^4.17.5"},"devDependencies":{"fuzzy":"^0.1.3"},"gitHead":"1a6939e43f7d59b22cf29e45e0886588a150ea37","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.0.1","scripts":{},"_shasum":"54ff1ed09777a103538562276b5cf4521a31d16d","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.1","_npmUser":{"name":"faressoft","email":"faressoft.com@gmail.com"},"dist":{"shasum":"54ff1ed09777a103538562276b5cf4521a31d16d","tarball":"http://registry-npm.ywwl.com/inquirer-checkbox-plus-prompt/download/inquirer-checkbox-plus-prompt-1.0.1.tgz","fileCount":9,"unpackedSize":103674,"integrity":"sha512-qvD7D56B6mYZ/6gkdzDzO0/6yJqoDvIJ3XW6jKf09YBBIhP8mxcWAbZHMqxDVPoclLfXatRwToE/czcOVhHCwg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAe6DD3RktMUj9jUY2hh3Ew296OLT1biu+hMD9er0fj0AiAeyPHAhoNhplpLb0fz8zS5qvpN2UxhOKFNvxm/quGH0A=="}],"size":52731,"noattachment":false,"key":"/inquirer-checkbox-plus-prompt/-/inquirer-checkbox-plus-prompt-1.0.1.tgz"},"maintainers":[{"name":"faressoft","email":"faressoft.com@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/inquirer-checkbox-plus-prompt_1.0.1_1520600716630_0.4645475328434774"},"_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":1520600716681,"_cnpm_publish_time":1520600716681,"dist-tags":{"latest":"1.4.2"}}