terminal-input
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

terminal-input

更好用的从终端读取用户输入

功能介绍

  1. 更便捷的从终端读取用户输入
  2. 提供颜色选择
  3. 基于 inquirer 与 chalk

安装

yarn add terminal-input
//or 
npm install terminal-input

使用

import { confirm,input } from 'terminal-input'
 
async function(){
    // 参数1 问题
    // 参数2 默认答案
    // 参数3 问题的颜色
    const answer = await confirm('how are you?','y',color?='yellow')
    // answer: true
     const answer2 = await input('how are you?','ok',color?='yellow')
    // answer: 'ok'
}
 

Package Sidebar

Install

npm i terminal-input

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

8.85 kB

Total Files

10

Last publish

Collaborators

  • g120hbq