{"_id":"inquirer-plugin-lazy-list","_rev":"4-5d8417eaf95c52a47a809f4d15f251ec","name":"inquirer-plugin-lazy-list","dist-tags":{"latest":"0.0.4"},"versions":{"0.0.1":{"name":"inquirer-plugin-lazy-list","version":"0.0.1","main":"src/index.js","license":"MIT","peerDependencies":{"inquirer":"*"},"repository":{"type":"git","url":"git://github.com/unshift/inquirer-plugin-lazy-list.git"},"gitHead":"e4444df4a9c10f4fd3ff3ca541e3906ec94e9dcf","description":"This package is a plugin for [inquirer].","bugs":{"url":"https://github.com/unshift/inquirer-plugin-lazy-list/issues"},"homepage":"https://github.com/unshift/inquirer-plugin-lazy-list#readme","_id":"inquirer-plugin-lazy-list@0.0.1","_npmVersion":"6.0.0","_nodeVersion":"10.1.0","_npmUser":{"name":"menubar","email":"menubar@protonmail.com"},"dist":{"integrity":"sha512-FzfBSMoVYGpealOq9z84JtNmwYdU5QPn9PI+5LQBBVJvBzW4Gkulte99yX2ld9ZDp9N3Qcz2DW2JyjhZjyNz2w==","shasum":"a602b8f48e7571013302fbf0a0d548375a6d10dc","tarball":"https://registry.npmjs.org/inquirer-plugin-lazy-list/-/inquirer-plugin-lazy-list-0.0.1.tgz","fileCount":3,"unpackedSize":2842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbKuO+CRA9TVsSAnZWagAAW+0P/iz1uI1aPt+NkbLjQoCK\nt7BVxxmgOpVvg+qPFfdtMeBbxsZBRvSHly0vm8w9mSp6F34tLj4UYiU8Lxs8\nFN+R+jsaLb79KuQbETGT8OdPrByS2ZemtBQhn5TvEShxZzf7cbfA7IYepsNl\nyKtkyKEaCg9j6GfWsPQRSpqPoIPlcmxiQAvHGidwjYcnImr4lGTh/Z1Qgslb\nWwAqjbzMFM2DbXErqI+Sw0MbYL8huW0mi28yIYgvgVBrMQw4eeluG/68zH6k\nALG1ZixnhdGfgeh8Wn6UlscDB2YUVbeMoovOTml7ZLhPJJaQQC8JKzDGGvLl\ndE5No5jYKYYbq5LcXfZAQDRkh0m3MREgBBt08LbMIUEHPeiytI3bB01vMW7s\nBYenyEKEjUWE2hSDZwzaWtxg/7YJQuj9byH65DhE83IAiRzVmfbxjGk3uHJR\nYt/mDgw1q9rP+FxBS/Clr8RhKETHPIt6DyYmVpDtoktDOdEbjlBbkDY685XG\nkFGyLOdo8HUdjgVtI2ZVbB/Ripq/9vcl3gtpYq8aj4j3piFd6rcCuhph5Rmt\nlZJLzt5Tay1XX7Xwyf1vo2iliD/v/HstAfjQq1NV0UnAZgYRi64D4pUckvcX\nen7bSGehGTPnmb0D8jQs+VrygbTqK8oQ1X67DqMMJAclghnH0BThyZ9/VTHY\n4jGD\r\n=mEF8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHIPJTAtMtT8yG1WGsKetIUg6J/1M89dlMcgXZas8tMUAiEAt4PMB6rwD+TxKfQdZ1FEX63pYRjaSIkHY3gx2y/ELr8="}]},"maintainers":[{"name":"menubar","email":"menubar@protonmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/inquirer-plugin-lazy-list_0.0.1_1529537470139_0.2529815054882554"},"_hasShrinkwrap":false},"0.0.2":{"name":"inquirer-plugin-lazy-list","version":"0.0.2","main":"src/index.js","license":"MIT","peerDependencies":{"inquirer":"*"},"repository":{"type":"git","url":"git://github.com/unshift/inquirer-plugin-lazy-list.git"},"gitHead":"fb40ff14f6cba726c783501787b229e3dbced963","description":"This package is a plugin for [inquirer](https://github.com/SBoudrias/Inquirer.js).","bugs":{"url":"https://github.com/unshift/inquirer-plugin-lazy-list/issues"},"homepage":"https://github.com/unshift/inquirer-plugin-lazy-list#readme","_id":"inquirer-plugin-lazy-list@0.0.2","_npmVersion":"6.0.0","_nodeVersion":"10.1.0","_npmUser":{"name":"menubar","email":"menubar@protonmail.com"},"dist":{"integrity":"sha512-l+m6rT4EazK+Fx7s+uon7a+9b5w8arrG72KksOp2drDCeBhL7HbNq7a4U3cVdj7nkGWiMKPZQEPaK4ddejeiWQ==","shasum":"df82aa76c1189f5103e3f402d159e85c4a9c64d6","tarball":"https://registry.npmjs.org/inquirer-plugin-lazy-list/-/inquirer-plugin-lazy-list-0.0.2.tgz","fileCount":3,"unpackedSize":2894,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbKuQKCRA9TVsSAnZWagAASGAP/1emeC5ZVriDfDv52S2P\nsLEiYEekRlPkvGWq+QoRYLGxOoTxvp6py8aOB/mUYXwM3OOvF6Q18nAwaqqm\nKu4USPET1D8/36erQALizzmhwvGJSGk/9jT9+ipoLqd/u4KrU0eZt3fSyOGI\ntfToTCIZJ8s8V2X2KYDgmfQ6p3AxnrW2IjFWQ//VbM7huazZjtE+xvJrXq2L\nkUILoBACEE/ezKaTQhJzKjivieS7laHFYl59xRIZnZaIDHS0cj4TbJnHDaKL\nXGOHJ7f+9xUxLCHXAE0mTT0SnNalpFW1l67E1XcOAc4APYJ26GpGFdXS5VKu\nueXUxSdodvLwA9LwPrA34qRB1JUmD9+JbokuipIGNmSx4dj8WTsw3Fe1GQv+\n0oeCUKbpf8o1pdcGwNTQTfE1lB6QPEK7yEjRNMeohQ5/3h7IAjR+Xo+GphOP\nmPNzb7JdTsBcgDbmGReM6OzlzW8y7TErS3jOEEn8+dEzfyH2Utb1qW3WCj+A\nyI7uCzpcjSeRxwZ2hKzM2y+lFI2ys9Wxv3X4HgSUsE/t6qaY7wrxo4eiXQKP\nwf49nzXu8oIt3DGm8Q4/hDRiNJvZ8ewnJoqs0KnUJmJSqT7JDr4htwPDe+tP\nv2HfeajFR2Lq9Qwo5wcDWzjIn+UZ/WYJQr3uIlAKWnAAwU2JEe+4Q4xlMZer\ngE4J\r\n=KdFV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFZg2FSF8HnLpLVNc92DJFpOuxV8a+eXsQKnYCHtzz1dAiEAseAwqL7yInTpSpsXpf24hsmTrmguM7Mu1Y2stbtZYms="}]},"maintainers":[{"name":"menubar","email":"menubar@protonmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/inquirer-plugin-lazy-list_0.0.2_1529537545692_0.9392087551900605"},"_hasShrinkwrap":false},"0.0.3":{"name":"inquirer-plugin-lazy-list","version":"0.0.3","main":"src/index.js","license":"MIT","peerDependencies":{"inquirer":"*"},"repository":{"type":"git","url":"git://github.com/unshift/inquirer-plugin-lazy-list.git"},"devDependencies":{"inquirer":"^6.0.0","node-fetch":"^2.1.2"},"gitHead":"50e10f560a8db24ab28057df0af8c98b91483c20","description":"This package is a plugin for [inquirer](https://github.com/SBoudrias/Inquirer.js).","bugs":{"url":"https://github.com/unshift/inquirer-plugin-lazy-list/issues"},"homepage":"https://github.com/unshift/inquirer-plugin-lazy-list#readme","_id":"inquirer-plugin-lazy-list@0.0.3","_npmVersion":"6.0.0","_nodeVersion":"10.1.0","_npmUser":{"name":"menubar","email":"menubar@protonmail.com"},"dist":{"integrity":"sha512-ai95cH2xBAcj6O24ckuuxAiJmg0CsMUpRSNGp2R04qUNJXZwaQI4jDKEKlatYqubEk7WPGMEBW1UY+JzJPDSnA==","shasum":"fdc7aba4f498ccbac4334e05dcd9854cc0624063","tarball":"https://registry.npmjs.org/inquirer-plugin-lazy-list/-/inquirer-plugin-lazy-list-0.0.3.tgz","fileCount":5,"unpackedSize":10434,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbKvVICRA9TVsSAnZWagAAgQ0P/ifftSXQQOTZ95XpUqv0\nbvt1Fmn6reZYUVwY1ap6jYl0QwMO3Nu4xBZQDFuy42utPkDqhjnZb6zzyFwE\nc9ImnlL3ysn++GxkaMyqYHB4uQ+44jAOP4Vy1+K5gLOiGJSW2iCrrw9/rGK0\n7Eq0zEflQUKjzcSPQ2zEMlu5IvhyBtce8NRhM6tJC3ryEzrUk8NgWwTe8LG2\nnG8qjg1d6C8UFZJt7d29gPi2eem1HRk8rdWCOhAUw5sNrSGr8sGcDHMVjvBN\n2cQS7fuU7qft60ao7us4bzaO5hzl7iRqSvEupwLu2RSb4e1VBJiHVU1H1akE\nhUa8S7sM0zbOLf4CLwmonUJTbhSfPmJ35VzqjpxvJZEfbW8KUvu7iYuubM8M\nGhgl5mGwNoqbVkwZ27Fa5k7MbXCYS+pDZ+x/N5Ln3pmaJEVziHC2yuJfzya9\nH6e/Nk0sVgUnSwE8bGxE/aE8bgNHUKXKWssravFK6QQambVi+vgknth1LmYk\nsNbRp5bCtKXYGZpLU1HG241S5te+G/iRVKwOzm7UiZkJfeH1JQoN/ZX8Pcgm\nr+5KKhRmvhffnX+zjunMg/hqUsLfT9V44+DJru+NJiViJUIEE7LUzDfR3Qgv\ne9AVC5pHNPWgT+iv1WsOqseFNoP/q+dXxrUNJMYgk+m+MVYf7OcrLYnWBiUI\njUAo\r\n=kYh5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDBdtHlwmiDyDF8sikP9TML+1MImh8/njstiL1UJ8Z47wIhAK1mRbCF3mPRS0K8ydaFGrgFonHPRaD9qoy/t8CGgVTn"}]},"maintainers":[{"name":"menubar","email":"menubar@protonmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/inquirer-plugin-lazy-list_0.0.3_1529541960211_0.4335870783860394"},"_hasShrinkwrap":false},"0.0.4":{"name":"inquirer-plugin-lazy-list","version":"0.0.4","main":"src/index.js","license":"MIT","peerDependencies":{"inquirer":"*"},"repository":{"type":"git","url":"git://github.com/unshift/inquirer-plugin-lazy-list.git"},"homepage":"https://github.com/unshift/inquirer-plugin-lazy-list","author":{"name":"Ben Gardner"},"keywords":["inquirer","cli"],"devDependencies":{"inquirer":"^6.0.0","node-fetch":"^2.1.2"},"gitHead":"07bc6ea1759e7528acbd51f48063da414968fac0","description":"This package is a plugin for [inquirer](https://github.com/SBoudrias/Inquirer.js).","bugs":{"url":"https://github.com/unshift/inquirer-plugin-lazy-list/issues"},"_id":"inquirer-plugin-lazy-list@0.0.4","_npmVersion":"6.0.0","_nodeVersion":"10.1.0","_npmUser":{"name":"menubar","email":"menubar@protonmail.com"},"dist":{"integrity":"sha512-XvnaJbfQ7yhINZmtCx69JSxzDY+q6WBMDrAPJm8G0zVLuUD9OzG4JHRuZIgj+F0i0nNh31ympWfF+yfMAhC0TA==","shasum":"9ae075780d73765896b83a47c20bb03b0397d543","tarball":"https://registry.npmjs.org/inquirer-plugin-lazy-list/-/inquirer-plugin-lazy-list-0.0.4.tgz","fileCount":5,"unpackedSize":10633,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbK3GpCRA9TVsSAnZWagAA/PUP/jy+NBTtdwwUg4e8O1NA\nn7GRwAoIV0Sb1E8weXS2HZZHN/tKMh4ucXSS0GgYwj/DXu7HNuJMTvnWfE5A\n2HL5RKlmvfe2cexdd7yEjWEDcqAk4sHABveKAwaZg42yxKSyGoy6yvfe34/G\nbljRA8zEKrrHleyzx3njCd9Qxw/49NngwZ07PgkhcrCPXtdyQuu5HBsmotmG\nMwvV5G/2kJDnlkZ7b+vqMZgEY3jf1foxjLFmWs/30WS45L9DVC4Y26lgF9Wg\nLeyOSyrs9oKTW8oQbZi7No24BHSRm+bzUih7bp6LpRzeDzCQCBR051yNxX3U\n6Lq2KsGGmxTOWbAe9ZbT1u5Yrw4LW7MrfYrE0pZPLAfEkwUXuil47+PLBGjZ\nG6XA7+Ak68cXqmuamqMlTIhf5mwHN19JYnPIUmDFZaOyNTHVFuvnq8gNN+PZ\nvuCmP0X7WP3OLKPBJ73Ha6iGvOwdPXykM+Mz3mVrZzb1RlIH+8dQYP1XhNsA\npsLHThTO9SNzT//qrCFumvfPflSs6mDCTXK8IIfJ0QGfYciz4VbgYNS81KtC\n8btnWiL4EjORK9KpUAdowMZB+Vv9MkVLg77HJDd1m9gk3XpIyeXiDBNGwmB1\nf+ZVH1QI5+ShM9L1quxTPDhsFVluSC9Y86Gye2PpIwx9F2Zpf0jlVVEkDMdr\npwZt\r\n=7oKk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCWDH+0YCMnU3SIVSPAmuVAH6Ezrw5zEiANIimXZsh8RAIgbqX6XwbdoEHGGwJtHiwy4Lp7DTIuPiU2rjqU1KgT7JU="}]},"maintainers":[{"name":"menubar","email":"menubar@protonmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/inquirer-plugin-lazy-list_0.0.4_1529573801348_0.40422502675146266"},"_hasShrinkwrap":false}},"time":{"created":"2018-06-20T23:31:10.139Z","0.0.1":"2018-06-20T23:31:10.239Z","modified":"2022-05-05T23:20:25.456Z","0.0.2":"2018-06-20T23:32:25.768Z","0.0.3":"2018-06-21T00:46:00.271Z","0.0.4":"2018-06-21T09:36:41.459Z"},"maintainers":[{"name":"menubar","email":"menubar@protonmail.com"}],"description":"This package is a plugin for [inquirer](https://github.com/SBoudrias/Inquirer.js).","homepage":"https://github.com/unshift/inquirer-plugin-lazy-list","repository":{"type":"git","url":"git://github.com/unshift/inquirer-plugin-lazy-list.git"},"bugs":{"url":"https://github.com/unshift/inquirer-plugin-lazy-list/issues"},"license":"MIT","readme":"## inquirer-plugin-lazy-list\n\nThis package is a plugin for [inquirer](https://github.com/SBoudrias/Inquirer.js).\n\nBy default an inquirer list of choices is assumed to be finite. This plugin allows choices to be added to a list in response to `onKeyDown` and `onKeyUp` events.\n\n## Options\n\nonChange(thisArg, type) => Promise | void>\n\nThe LazyList component is just like inquirer's default List component, with the option to set an onChange handler. The onChange handler is called when an onKeyDown or onKeyUp event transpires. The onChange handler should return undefined or a promise that resolves to new choices to add to the list.\n\n\n## Example\n\n```js\nconst inquirer = require('inquirer')\nconst fetch = require('node-fetch')\n\ninquirer.registerPrompt('lazy-list', require('inquirer-plugin-lazy-list'))\n\nconst pageSize = 5\n\nconst fetchMore = (n) => {\n let url = `https://jsonplaceholder.typicode.com/posts/${n}`\n return fetch(url)\n .then(resp => resp.json())\n .then(json => ([{ value: json.id, name: `${json.id}` }]))\n}\n\ninquirer.prompt({\n type: 'lazy-list',\n name: 'posts',\n message: 'Inbox',\n pageSize: pageSize,\n choices: new Array(5).fill(0).map((_, i) => ({ value: i, name: i })),\n onChange: (state, eventType) => {\n let index = state.selected\n let listLength = state.opt.choices.length\n let shouldFetchMore = (index + pageSize) > listLength\n if (\n eventType === 'onDownKey' &&\n shouldFetchMore\n ) {\n return fetchMore(state.opt.choices.length)\n .then(choices => {\n return state.opt.choices.choices.concat(choices)\n })\n }\n }\n})\n\n```","readmeFilename":"readme.md","keywords":["inquirer","cli"],"author":{"name":"Ben Gardner"}}