├── .gitignore ├── .npmignore ├── .vscode └── launch.json ├── LICENSE ├── Makefile ├── README.md ├── examples └── basic.js ├── package.json ├── screenshot.png ├── src └── index.ts ├── tsconfig.json ├── types └── index.d.ts └── yarn.lock /.gitignore: -------------------------------------------------------------------------------- 1 | dist/ -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | examples/ 2 | screenshot.png 3 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "type": "node", 9 | "request": "attach", 10 | "name": "Attach", 11 | "port": 9229 12 | } 13 | ] 14 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 clinyong 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | SHELL := /bin/bash 2 | export PATH := $(shell pwd)/node_modules/.bin:$(PATH) 3 | 4 | dev: 5 | tsc -w 6 | 7 | build: 8 | tsc 9 | 10 | publish:build 11 | npm publish 12 | 13 | publishPatch:build 14 | npm version patch 15 | npm publish 16 | git push -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## inquirer-search-checkbox 2 | 3 | ![](screenshot.png) 4 | 5 | ### Install 6 | 7 | ``` 8 | $ yarn add inquirer-search-checkbox 9 | ``` 10 | 11 | ### Usage 12 | 13 | ```js 14 | inquirer.registerPrompt('search-checkbox', require('inquirer-search-checkbox')); 15 | ``` 16 | 17 | See [examples](https://github.com/clinyong/inquirer-search-checkbox/tree/master/examples) for detail. -------------------------------------------------------------------------------- /examples/basic.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var inquirer = require("inquirer"); 3 | inquirer.registerPrompt("search-checkbox", require("../dist")); 4 | 5 | inquirer 6 | .prompt([ 7 | { 8 | type: "search-checkbox", 9 | message: "Select toppings", 10 | name: "toppings", 11 | choices: [ 12 | { 13 | name: "Pepperoni" 14 | }, 15 | { 16 | name: "Ham" 17 | }, 18 | { 19 | name: "Ground Meat" 20 | }, 21 | { 22 | name: "Bacon" 23 | }, 24 | { 25 | name: "Mozzarella" 26 | } 27 | ], 28 | validate: function(answer) { 29 | if (answer.length < 1) { 30 | return "You must choose at least one topping."; 31 | } 32 | return true; 33 | } 34 | } 35 | ]) 36 | .then(function(answers) { 37 | console.log(JSON.stringify(answers, null, " ")); 38 | }) 39 | .catch(e => console.log(e)); 40 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "inquirer-search-checkbox", 3 | "version": "1.0.0", 4 | "description": "Searchable Inquirer checkbox", 5 | "main": "dist/index.js", 6 | "scripts": { 7 | "start": "tsc -w", 8 | "build": "tsc" 9 | }, 10 | "keywords": [], 11 | "author": "", 12 | "license": "MIT", 13 | "devDependencies": { 14 | "@types/figures": "^2.0.0", 15 | "@types/inquirer": "^0.0.35", 16 | "@types/node": "^8.0.47", 17 | "typescript": "^2.5.3" 18 | }, 19 | "dependencies": { 20 | "chalk": "^2.3.0", 21 | "figures": "^2.0.0", 22 | "fuzzy": "^0.1.3", 23 | "inquirer": "^3.3.0" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clinyong/inquirer-search-checkbox/090c30def0fd87c44378ed9efa61300f47d22056/screenshot.png -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | import Base = require("inquirer/lib/prompts/base"); 2 | import observe = require("inquirer/lib/utils/events"); 3 | import figures = require("figures"); 4 | import Paginator = require("inquirer/lib/utils/paginator"); 5 | import chalk from "chalk"; 6 | import * as fuzzy from "fuzzy"; 7 | 8 | interface Event { 9 | key: { 10 | name: string; 11 | ctrl: boolean; 12 | meta: boolean; 13 | }; 14 | value: string; 15 | } 16 | 17 | interface Choice extends Base.Choice { 18 | id: number; 19 | } 20 | 21 | const ignoreKeys = ["up", "down", "space"]; 22 | 23 | function getCheckbox(checked: boolean) { 24 | return checked ? chalk.green(figures.radioOn) : figures.radioOff; 25 | } 26 | 27 | function isSeparator(c: Base.Choice) { 28 | return c.type === "separator"; 29 | } 30 | 31 | function renderChoices(choices: Choice[], pointer: number) { 32 | var output = ""; 33 | 34 | choices.forEach(function(choice, i) { 35 | if (choice.disabled) { 36 | output = `${output} - ${choice.name} (Disabled)`; 37 | } else { 38 | var isSelected = i === pointer; 39 | output += isSelected ? chalk.cyan(figures.pointer) : " "; 40 | output += getCheckbox(choice.checked) + " " + choice.name; 41 | } 42 | 43 | output += "\n"; 44 | }); 45 | 46 | return output.replace(/\n$/, ""); 47 | } 48 | 49 | class SearchBox extends Base { 50 | private pointer: number = 0; 51 | private selection: string[] = []; 52 | private done: (state: any) => void; 53 | private choices: Choice[] = []; 54 | private filterList: Choice[] = []; 55 | private paginator: Paginator = new Paginator(); 56 | 57 | constructor(...params: any[]) { 58 | super(...params); 59 | const { choices } = this.opt; 60 | 61 | if (!choices) { 62 | this.throwParamError("choices"); 63 | } 64 | 65 | const item = choices.find(c => isSeparator(c)); 66 | if (item) { 67 | throw new Error("Separator is not allowed in choices."); 68 | } 69 | 70 | this.filterList = this.choices = choices 71 | .filter(() => true) // fix slice is not a function 72 | .map((item, id) => ({ ...item, id })); 73 | } 74 | 75 | render(error?: string) { 76 | // Render question 77 | var message = this.getQuestion(); 78 | var bottomContent = ""; 79 | const tip = chalk.dim("(Press to select, to submit.)"); 80 | 81 | // Render choices or answer depending on the state 82 | if (this.status === "answered") { 83 | message += chalk.cyan(this.selection.join(", ")); 84 | } else { 85 | message += `${tip} ${this.rl.line}`; 86 | const choicesStr = renderChoices(this.filterList, this.pointer); 87 | bottomContent = this.paginator.paginate( 88 | choicesStr, 89 | this.pointer, 90 | this.opt.pageSize 91 | ); 92 | } 93 | 94 | if (error) { 95 | bottomContent = chalk.red(">> ") + error; 96 | } 97 | 98 | this.screen.render(message, bottomContent); 99 | } 100 | 101 | filterChoices() { 102 | const options = { 103 | extract: (el: Choice) => el.name 104 | }; 105 | 106 | this.filterList = fuzzy.filter(this.rl.line, this.choices, options).map(el => el.original); 107 | } 108 | 109 | toggleChoice(index: number) { 110 | const item = this.filterList[index]; 111 | if (item) { 112 | this.choices[item.id].checked = !item.checked; 113 | } 114 | } 115 | 116 | onSpaceKey() { 117 | this.rl.line = this.rl.line.trim(); // remove space from input 118 | this.toggleChoice(this.pointer); 119 | this.render(); 120 | } 121 | 122 | onDownKey() { 123 | const len = this.filterList.length; 124 | this.pointer = this.pointer < len - 1 ? this.pointer + 1 : 0; 125 | this.render(); 126 | } 127 | 128 | onUpKey() { 129 | const len = this.filterList.length; 130 | this.pointer = this.pointer > 0 ? this.pointer - 1 : len - 1; 131 | this.render(); 132 | } 133 | 134 | onAllKey() { 135 | const existCancel = this.filterList.find(item => !item.checked); 136 | this.filterList.forEach(item => { 137 | this.choices[item.id].checked = !!existCancel; 138 | }); 139 | this.render(); 140 | } 141 | 142 | onEnd(state: any) { 143 | this.status = "answered"; 144 | 145 | // Rerender prompt (and clean subline error) 146 | this.render(); 147 | 148 | this.screen.done(); 149 | this.done(state.value); 150 | } 151 | 152 | onError(state: any) { 153 | this.render(state.isValid); 154 | } 155 | 156 | onKeyPress() { 157 | this.pointer = 0; 158 | this.filterChoices(); 159 | this.render(); 160 | } 161 | 162 | getCurrentValue() { 163 | const choices = this.choices.filter( 164 | item => item.checked && !item.disabled 165 | ); 166 | 167 | this.selection = choices.map(item => item.short); 168 | return choices.map(item => item.value); 169 | } 170 | 171 | _run(cb: any) { 172 | this.done = cb; 173 | 174 | const events = observe(this.rl); 175 | const upKey = events.keypress.filter( 176 | (e: Event) => 177 | e.key.name === "up" || (e.key.name === "p" && e.key.ctrl) 178 | ); 179 | const downKey = events.keypress.filter( 180 | (e: Event) => 181 | e.key.name === "down" || (e.key.name === "n" && e.key.ctrl) 182 | ); 183 | const allKey = events.keypress.filter( 184 | (e: Event) => e.key.name === "o" && e.key.ctrl 185 | ); 186 | const validation = this.handleSubmitEvents( 187 | events.line.map(this.getCurrentValue.bind(this)) 188 | ); 189 | 190 | validation.success.forEach(this.onEnd.bind(this)); 191 | validation.error.forEach(this.onError.bind(this)); 192 | upKey.forEach(this.onUpKey.bind(this)); 193 | downKey.forEach(this.onDownKey.bind(this)); 194 | allKey.takeUntil(validation.success).forEach(this.onAllKey.bind(this)); 195 | events.spaceKey 196 | .takeUntil(validation.success) 197 | .forEach(this.onSpaceKey.bind(this)); 198 | events.keypress 199 | .filter( 200 | (e: Event) => !e.key.ctrl && !ignoreKeys.includes(e.key.name) 201 | ) 202 | .takeUntil(validation.success) 203 | .forEach(this.onKeyPress.bind(this)); 204 | 205 | this.render(); 206 | return this; 207 | } 208 | } 209 | 210 | export = SearchBox; 211 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "strict": true, 4 | "sourceMap": false, 5 | "noImplicitReturns": true, 6 | "module": "CommonJS", 7 | "target": "es5", 8 | "moduleResolution": "node", 9 | "removeComments": true, 10 | "noUnusedLocals": true, 11 | "baseUrl": "./src", 12 | "outDir": "./dist", 13 | "lib": [ 14 | "ES6", 15 | "DOM", 16 | "DOM.Iterable", 17 | "ScriptHost", 18 | "ES2016.Array.Include" 19 | ] 20 | }, 21 | "include": ["./src/**.ts", "./types/**/*.d.ts"], 22 | "exclude": ["node_modules", "./dist"] 23 | } 24 | -------------------------------------------------------------------------------- /types/index.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | declare module "inquirer/lib/prompts/base" { 4 | export = Base; 5 | 6 | class Base { 7 | opt: { 8 | choices: Base.Choice[]; 9 | pageSize: number; 10 | }; 11 | rl: { 12 | line: string; 13 | write(params: any): void; 14 | moveCursor(dx: number): void; 15 | }; 16 | status: string; 17 | screen: { 18 | render: (content: string, bottomContent: string) => void; 19 | done: () => void; 20 | }; 21 | 22 | constructor(...params: any[]); 23 | 24 | throwParamError(params: string): void; 25 | getQuestion(): string; 26 | handleSubmitEvents(submit: any): Base.Validation; 27 | } 28 | 29 | namespace Base { 30 | export interface Validation { 31 | success: any; 32 | error: any; 33 | } 34 | 35 | export interface Choice { 36 | name: string; 37 | type: string; 38 | short: string; 39 | value: string; 40 | line: string; 41 | disabled: boolean; 42 | checked: boolean; 43 | } 44 | } 45 | } 46 | 47 | declare module "inquirer/lib/utils/events" { 48 | interface Events { 49 | keypress: Rx.Observable; 50 | line: Rx.Observable; 51 | spaceKey: Rx.Observable; 52 | } 53 | 54 | function observe(params: any): Events; 55 | export = observe; 56 | } 57 | 58 | declare module "inquirer/lib/utils/paginator" { 59 | class Paginator { 60 | paginate(output: string, active: number, pageSize: number): string; 61 | } 62 | export = Paginator; 63 | } 64 | declare module "cli-cursor"; 65 | declare module "ansi-escapes"; 66 | -------------------------------------------------------------------------------- /yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | "@types/figures@^2.0.0": 6 | version "2.0.0" 7 | resolved "http://registry.npm.taobao.org/@types/figures/download/@types/figures-2.0.0.tgz#e624a9ad71db49b9c8b9bbd59fe1ad04c443913c" 8 | 9 | "@types/inquirer@^0.0.35": 10 | version "0.0.35" 11 | resolved "http://registry.npm.taobao.org/@types/inquirer/download/@types/inquirer-0.0.35.tgz#e054657cf2d10963823957d4d06ec244f05c65be" 12 | dependencies: 13 | "@types/rx" "*" 14 | "@types/through" "*" 15 | 16 | "@types/node@*", "@types/node@^8.0.47": 17 | version "8.0.47" 18 | resolved "http://registry.npm.taobao.org/@types/node/download/@types/node-8.0.47.tgz#968e596f91acd59069054558a00708c445ca30c2" 19 | 20 | "@types/rx-core-binding@*": 21 | version "4.0.4" 22 | resolved "http://registry.npm.taobao.org/@types/rx-core-binding/download/@types/rx-core-binding-4.0.4.tgz#d969d32f15a62b89e2862c17b3ee78fe329818d3" 23 | dependencies: 24 | "@types/rx-core" "*" 25 | 26 | "@types/rx-core@*": 27 | version "4.0.3" 28 | resolved "http://registry.npm.taobao.org/@types/rx-core/download/@types/rx-core-4.0.3.tgz#0b3354b1238cedbe2b74f6326f139dbc7a591d60" 29 | 30 | "@types/rx-lite-aggregates@*": 31 | version "4.0.3" 32 | resolved "http://registry.npm.taobao.org/@types/rx-lite-aggregates/download/@types/rx-lite-aggregates-4.0.3.tgz#6efb2b7f3d5f07183a1cb2bd4b1371d7073384c2" 33 | dependencies: 34 | "@types/rx-lite" "*" 35 | 36 | "@types/rx-lite-async@*": 37 | version "4.0.2" 38 | resolved "http://registry.npm.taobao.org/@types/rx-lite-async/download/@types/rx-lite-async-4.0.2.tgz#27fbf0caeff029f41e2d2aae638b05e91ceb600c" 39 | dependencies: 40 | "@types/rx-lite" "*" 41 | 42 | "@types/rx-lite-backpressure@*": 43 | version "4.0.3" 44 | resolved "http://registry.npm.taobao.org/@types/rx-lite-backpressure/download/@types/rx-lite-backpressure-4.0.3.tgz#05abb19bdf87cc740196c355e5d0b37bb50b5d56" 45 | dependencies: 46 | "@types/rx-lite" "*" 47 | 48 | "@types/rx-lite-coincidence@*": 49 | version "4.0.3" 50 | resolved "http://registry.npm.taobao.org/@types/rx-lite-coincidence/download/@types/rx-lite-coincidence-4.0.3.tgz#80bd69acc4054a15cdc1638e2dc8843498cd85c0" 51 | dependencies: 52 | "@types/rx-lite" "*" 53 | 54 | "@types/rx-lite-experimental@*": 55 | version "4.0.1" 56 | resolved "http://registry.npm.taobao.org/@types/rx-lite-experimental/download/@types/rx-lite-experimental-4.0.1.tgz#c532f5cbdf3f2c15da16ded8930d1b2984023cbd" 57 | dependencies: 58 | "@types/rx-lite" "*" 59 | 60 | "@types/rx-lite-joinpatterns@*": 61 | version "4.0.1" 62 | resolved "http://registry.npm.taobao.org/@types/rx-lite-joinpatterns/download/@types/rx-lite-joinpatterns-4.0.1.tgz#f70fe370518a8432f29158cc92ffb56b4e4afc3e" 63 | dependencies: 64 | "@types/rx-lite" "*" 65 | 66 | "@types/rx-lite-testing@*": 67 | version "4.0.1" 68 | resolved "http://registry.npm.taobao.org/@types/rx-lite-testing/download/@types/rx-lite-testing-4.0.1.tgz#21b19d11f4dfd6ffef5a9d1648e9c8879bfe21e9" 69 | dependencies: 70 | "@types/rx-lite-virtualtime" "*" 71 | 72 | "@types/rx-lite-time@*": 73 | version "4.0.3" 74 | resolved "http://registry.npm.taobao.org/@types/rx-lite-time/download/@types/rx-lite-time-4.0.3.tgz#0eda65474570237598f3448b845d2696f2dbb1c4" 75 | dependencies: 76 | "@types/rx-lite" "*" 77 | 78 | "@types/rx-lite-virtualtime@*": 79 | version "4.0.3" 80 | resolved "http://registry.npm.taobao.org/@types/rx-lite-virtualtime/download/@types/rx-lite-virtualtime-4.0.3.tgz#4b30cacd0fe2e53af29f04f7438584c7d3959537" 81 | dependencies: 82 | "@types/rx-lite" "*" 83 | 84 | "@types/rx-lite@*": 85 | version "4.0.5" 86 | resolved "http://registry.npm.taobao.org/@types/rx-lite/download/@types/rx-lite-4.0.5.tgz#b3581525dff69423798daa9a0d33c1e66a5e8c4c" 87 | dependencies: 88 | "@types/rx-core" "*" 89 | "@types/rx-core-binding" "*" 90 | 91 | "@types/rx@*": 92 | version "4.1.1" 93 | resolved "http://registry.npm.taobao.org/@types/rx/download/@types/rx-4.1.1.tgz#598fc94a56baed975f194574e0f572fd8e627a48" 94 | dependencies: 95 | "@types/rx-core" "*" 96 | "@types/rx-core-binding" "*" 97 | "@types/rx-lite" "*" 98 | "@types/rx-lite-aggregates" "*" 99 | "@types/rx-lite-async" "*" 100 | "@types/rx-lite-backpressure" "*" 101 | "@types/rx-lite-coincidence" "*" 102 | "@types/rx-lite-experimental" "*" 103 | "@types/rx-lite-joinpatterns" "*" 104 | "@types/rx-lite-testing" "*" 105 | "@types/rx-lite-time" "*" 106 | "@types/rx-lite-virtualtime" "*" 107 | 108 | "@types/through@*": 109 | version "0.0.29" 110 | resolved "http://registry.npm.taobao.org/@types/through/download/@types/through-0.0.29.tgz#72943aac922e179339c651fa34a4428a4d722f93" 111 | dependencies: 112 | "@types/node" "*" 113 | 114 | ansi-escapes@^3.0.0: 115 | version "3.0.0" 116 | resolved "http://registry.npm.taobao.org/ansi-escapes/download/ansi-escapes-3.0.0.tgz#ec3e8b4e9f8064fc02c3ac9b65f1c275bda8ef92" 117 | 118 | ansi-regex@^3.0.0: 119 | version "3.0.0" 120 | resolved "http://registry.npm.taobao.org/ansi-regex/download/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" 121 | 122 | ansi-styles@^3.1.0: 123 | version "3.2.0" 124 | resolved "http://registry.npm.taobao.org/ansi-styles/download/ansi-styles-3.2.0.tgz#c159b8d5be0f9e5a6f346dab94f16ce022161b88" 125 | dependencies: 126 | color-convert "^1.9.0" 127 | 128 | chalk@^2.0.0, chalk@^2.3.0: 129 | version "2.3.0" 130 | resolved "http://registry.npm.taobao.org/chalk/download/chalk-2.3.0.tgz#b5ea48efc9c1793dccc9b4767c93914d3f2d52ba" 131 | dependencies: 132 | ansi-styles "^3.1.0" 133 | escape-string-regexp "^1.0.5" 134 | supports-color "^4.0.0" 135 | 136 | cli-cursor@^2.1.0: 137 | version "2.1.0" 138 | resolved "http://registry.npm.taobao.org/cli-cursor/download/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" 139 | dependencies: 140 | restore-cursor "^2.0.0" 141 | 142 | cli-width@^2.0.0: 143 | version "2.2.0" 144 | resolved "http://registry.npm.taobao.org/cli-width/download/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639" 145 | 146 | color-convert@^1.9.0: 147 | version "1.9.0" 148 | resolved "http://registry.npm.taobao.org/color-convert/download/color-convert-1.9.0.tgz#1accf97dd739b983bf994d56fec8f95853641b7a" 149 | dependencies: 150 | color-name "^1.1.1" 151 | 152 | color-name@^1.1.1: 153 | version "1.1.3" 154 | resolved "http://registry.npm.taobao.org/color-name/download/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" 155 | 156 | escape-string-regexp@^1.0.5: 157 | version "1.0.5" 158 | resolved "http://registry.npm.taobao.org/escape-string-regexp/download/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" 159 | 160 | external-editor@^2.0.4: 161 | version "2.0.5" 162 | resolved "http://registry.npm.taobao.org/external-editor/download/external-editor-2.0.5.tgz#52c249a3981b9ba187c7cacf5beb50bf1d91a6bc" 163 | dependencies: 164 | iconv-lite "^0.4.17" 165 | jschardet "^1.4.2" 166 | tmp "^0.0.33" 167 | 168 | figures@^2.0.0: 169 | version "2.0.0" 170 | resolved "http://registry.npm.taobao.org/figures/download/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" 171 | dependencies: 172 | escape-string-regexp "^1.0.5" 173 | 174 | fuzzy@^0.1.3: 175 | version "0.1.3" 176 | resolved "http://registry.npm.taobao.org/fuzzy/download/fuzzy-0.1.3.tgz#4c76ec2ff0ac1a36a9dccf9a00df8623078d4ed8" 177 | 178 | has-flag@^2.0.0: 179 | version "2.0.0" 180 | resolved "http://registry.npm.taobao.org/has-flag/download/has-flag-2.0.0.tgz#e8207af1cc7b30d446cc70b734b5e8be18f88d51" 181 | 182 | iconv-lite@^0.4.17: 183 | version "0.4.19" 184 | resolved "http://registry.npm.taobao.org/iconv-lite/download/iconv-lite-0.4.19.tgz#f7468f60135f5e5dad3399c0a81be9a1603a082b" 185 | 186 | inquirer@^3.3.0: 187 | version "3.3.0" 188 | resolved "http://registry.npm.taobao.org/inquirer/download/inquirer-3.3.0.tgz#9dd2f2ad765dcab1ff0443b491442a20ba227dc9" 189 | dependencies: 190 | ansi-escapes "^3.0.0" 191 | chalk "^2.0.0" 192 | cli-cursor "^2.1.0" 193 | cli-width "^2.0.0" 194 | external-editor "^2.0.4" 195 | figures "^2.0.0" 196 | lodash "^4.3.0" 197 | mute-stream "0.0.7" 198 | run-async "^2.2.0" 199 | rx-lite "^4.0.8" 200 | rx-lite-aggregates "^4.0.8" 201 | string-width "^2.1.0" 202 | strip-ansi "^4.0.0" 203 | through "^2.3.6" 204 | 205 | is-fullwidth-code-point@^2.0.0: 206 | version "2.0.0" 207 | resolved "http://registry.npm.taobao.org/is-fullwidth-code-point/download/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" 208 | 209 | is-promise@^2.1.0: 210 | version "2.1.0" 211 | resolved "http://registry.npm.taobao.org/is-promise/download/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa" 212 | 213 | jschardet@^1.4.2: 214 | version "1.5.1" 215 | resolved "http://registry.npm.taobao.org/jschardet/download/jschardet-1.5.1.tgz#c519f629f86b3a5bedba58a88d311309eec097f9" 216 | 217 | lodash@^4.3.0: 218 | version "4.17.4" 219 | resolved "http://registry.npm.taobao.org/lodash/download/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" 220 | 221 | mimic-fn@^1.0.0: 222 | version "1.1.0" 223 | resolved "http://registry.npm.taobao.org/mimic-fn/download/mimic-fn-1.1.0.tgz#e667783d92e89dbd342818b5230b9d62a672ad18" 224 | 225 | mute-stream@0.0.7: 226 | version "0.0.7" 227 | resolved "http://registry.npm.taobao.org/mute-stream/download/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" 228 | 229 | onetime@^2.0.0: 230 | version "2.0.1" 231 | resolved "http://registry.npm.taobao.org/onetime/download/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4" 232 | dependencies: 233 | mimic-fn "^1.0.0" 234 | 235 | os-tmpdir@~1.0.2: 236 | version "1.0.2" 237 | resolved "http://registry.npm.taobao.org/os-tmpdir/download/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" 238 | 239 | restore-cursor@^2.0.0: 240 | version "2.0.0" 241 | resolved "http://registry.npm.taobao.org/restore-cursor/download/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" 242 | dependencies: 243 | onetime "^2.0.0" 244 | signal-exit "^3.0.2" 245 | 246 | run-async@^2.2.0: 247 | version "2.3.0" 248 | resolved "http://registry.npm.taobao.org/run-async/download/run-async-2.3.0.tgz#0371ab4ae0bdd720d4166d7dfda64ff7a445a6c0" 249 | dependencies: 250 | is-promise "^2.1.0" 251 | 252 | rx-lite-aggregates@^4.0.8: 253 | version "4.0.8" 254 | resolved "http://registry.npm.taobao.org/rx-lite-aggregates/download/rx-lite-aggregates-4.0.8.tgz#753b87a89a11c95467c4ac1626c4efc4e05c67be" 255 | dependencies: 256 | rx-lite "*" 257 | 258 | rx-lite@*, rx-lite@^4.0.8: 259 | version "4.0.8" 260 | resolved "http://registry.npm.taobao.org/rx-lite/download/rx-lite-4.0.8.tgz#0b1e11af8bc44836f04a6407e92da42467b79444" 261 | 262 | signal-exit@^3.0.2: 263 | version "3.0.2" 264 | resolved "http://registry.npm.taobao.org/signal-exit/download/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" 265 | 266 | string-width@^2.1.0: 267 | version "2.1.1" 268 | resolved "http://registry.npm.taobao.org/string-width/download/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" 269 | dependencies: 270 | is-fullwidth-code-point "^2.0.0" 271 | strip-ansi "^4.0.0" 272 | 273 | strip-ansi@^4.0.0: 274 | version "4.0.0" 275 | resolved "http://registry.npm.taobao.org/strip-ansi/download/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" 276 | dependencies: 277 | ansi-regex "^3.0.0" 278 | 279 | supports-color@^4.0.0: 280 | version "4.5.0" 281 | resolved "http://registry.npm.taobao.org/supports-color/download/supports-color-4.5.0.tgz#be7a0de484dec5c5cddf8b3d59125044912f635b" 282 | dependencies: 283 | has-flag "^2.0.0" 284 | 285 | through@^2.3.6: 286 | version "2.3.8" 287 | resolved "http://registry.npm.taobao.org/through/download/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" 288 | 289 | tmp@^0.0.33: 290 | version "0.0.33" 291 | resolved "http://registry.npm.taobao.org/tmp/download/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" 292 | dependencies: 293 | os-tmpdir "~1.0.2" 294 | 295 | typescript@^2.5.3: 296 | version "2.5.3" 297 | resolved "http://registry.npm.taobao.org/typescript/download/typescript-2.5.3.tgz#df3dcdc38f3beb800d4bc322646b04a3f6ca7f0d" 298 | --------------------------------------------------------------------------------