node.js - 写一个nodejs的命令行工具,提供各种选项,通过上下移动后回车来选择,具体如图
大家讲道理
大家讲道理 2017-04-17 14:47:08
0
1
903

如图这样,空格勾选,上下移动光标,回车确定

想知道怎么实现的

大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

reply all(1)
Ty80

It’s troublesome to implement one by yourself. Fortunately, there are enough “giants’ shoulders” in the open source world to step on for us.

You can refer to other node open source libraries. For example, grunt and yo provide functions like 问答 in the project initialization function.

Let’s see how they achieve it?

  • grunt: implemented through the prompt library, click the portal

  • yo: Implemented through the Inquirer.js library, click on the portal

Attached is a screenshot of the yoinitialization project

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!