<h1 align="center">Enquirer</h1>
<p align="center">
<a href="https://npmjs.org/package/enquirer">
<img src="https://img.shields.io/npm/v/enquirer.svg" alt="version">
</a>
<a href="https://travis-ci.org/enquirer/enquirer">
<img src="https://img.shields.io/travis/enquirer/enquirer.svg" alt="travis">
</a>
<a href="https://npmjs.org/package/enquirer">
<img src="https://img.shields.io/npm/dm/enquirer.svg" alt="downloads">
</a>
</p>
<br>
<br>
<p align="center">
<b>Stylish CLI prompts that are user-friendly, intuitive and easy to create.</b><br>
<sub>>_ Prompts should be more like conversations than inquisitions▌</sub>
</p>
<br>
<p align="center">
<sub>(Example shows Enquirer's <a href="#survey-prompt">Survey Prompt</a>)</a></sub>
<img src="https://raw.githubusercontent.com/enquirer/enquirer/master/media/survey-prompt.gif" alt="Enquirer Survey Prompt" width="750"><br>
<sub>The terminal in all examples is <a href="https://hyper.is/">Hyper</a>, theme is <a href="https://github.com/jonschlinkert/hyper-monokai-extended">hyper-monokai-extended</a>.</sub><br><br>
<a href="#built-in-prompts"><strong>See more prompt examples</strong></a>
</p>
<br>
<br>
Created by [jonschlinkert](https://github.com/jonschlinkert) and [doowb](https://github.com/doowb), Enquirer is fast, easy to use, and lightweight enough for small projects, while also being powerful and customizable enough for the most advanced use cases.
* **Fast** - [Loads in ~4ms](#-performance) (that's about _3-4 times faster than a [single frame of a HD movie](http://www.endmemo.com/sconvert/framespersecondframespermillisecond.php) at 60fps_)
* **Lightweight** - Only one dependency, the excellent [ansi-colors](https://github.com/doowb/ansi-colors) by [Brian Woodward](https://github.com/doowb).
* **Easy to implement** - Uses promises and async/await and sensible defaults to make prompts easy to create and implement.
* **Easy to use** - Thrill your users with a better experience! Navigating around input and choices is a breeze. You can even create [quizzes](examples/fun/countdown.js), or [record](examples/fun/record.js) and [playback](examples/fun/play.js) key bindings to aid with tutorials and videos.
* **Intuitive** - Keypress combos are available to simplify usage.
* **Flexible** - All prompts can be used standalone or chained together.
* **Stylish** - Easily override semantic styles and symbols for any part of the prompt.
* **Extensible** - Easily create and use custom prompts by extending Enquirer's built-in [prompts](#-prompts).
* **Pluggable** - Add advanced features to Enquirer using plugins.
* **Validation** - Optionally validate user input with any prompt.
* **Well tested** - All prompts are well-tested, and tests are easy to create without having to use brittle, hacky solutions to spy on prompts or "inject" values.
* **Examples** - There are numerous [examples](examples) available to help you get started.
If you like Enquirer, please consider starring or tweeting about this project to show your support. Thanks!
<br>
<p align="center">
<b>>_ Ready to start making prompts your users will love? ▌</b><br>
<img src="https://raw.githubusercontent.com/enquirer/enquirer/master/media/heartbeat.gif" alt="Enquirer Select Prompt with heartbeat example" width="750">
</p>
<br>
<br>
## ❯ Getting started
Get started with Enquirer, the most powerful and easy-to-use Node.js library for creating interactive CLI prompts.
* [Install](#-install)
* [Usage](#-usage)
* [Enquirer](#-enquirer)
* [Prompts](#-prompts)
- [Built-in Prompts](#-prompts)
- [Custom Prompts](#-custom-prompts)
* [Key Bindings](#-key-bindings)
* [Options](#-options)
* [Release History](#-release-history)
* [Performance](#-performance)
* [About](#-about)
<br>
## ❯ Install
Install with [npm](https://www.npmjs.com/):
```sh
$ npm install enquirer --save
```
Install with [yarn](https://yarnpkg.com/en/):
```sh
$ yarn add enquirer
```
<p align="center">
<img src="https://raw.githubusercontent.com/enquirer/enquirer/master/media/npm-install.gif" alt="Install Enquirer with NPM" width="750">
</p>
_(Requires Node.js 8.6 or higher. Please let us know if you need support for an earlier version by creating an [issue](../../issues/new).)_
<br>
## ❯ Usage
### Single prompt
The easiest way to get started with enquirer is to pass a [question object](#prompt-options) to the `prompt` method.
```js
const { prompt } = require('enquirer');
const response = await prompt({
type: 'input',
name: 'username',
message: 'What is your username?'
});
console.log(response); // { username: 'jonschlinkert' }
```
_(Examples with `await` need to be run inside an `async` function)_
### Multiple prompts
Pass an array of ["question" objects](#prompt-options) to run a series of prompts.
```js
const response = await prompt([
{
type: 'input',
name: 'name',
message: 'What is your name?'
},
{
type: 'input',
name: 'username',
message: 'What is your username?'
}
]);
console.log(response); // { name: 'Edward Chan', username: 'edwardmchan' }
```
### Different ways to run enquirer
#### 1. By importing the specific `built-in prompt`
```js
const { Confirm } = require('enquirer');
const prompt = new Confirm({
name: 'question',
message: 'Did you like enquirer?'
});
prompt.run()
.then(answer => console.log('Answer:', answer));
```
#### 2. By passing the options to `prompt`
```js
const { prompt } = require('enquirer');
prompt({
type: 'confirm',
name: 'question',
message: 'Did you like enquirer?'
})
.then(answer => console.log('Answer:', answer));
```
**Jump to**: [Getting Started](#-getting-started) · [Prompts](#-prompts) · [Options](#-options) · [Key Bindings](#-key-bindings)
<br>
## ❯ Enquirer
**Enquirer is a prompt runner**
Add Enquirer to your JavaScript project with following line of code.
```js
const Enquirer = require('enquirer');
```
The main export of this library is the `Enquirer` class, which has methods and features designed to simplify running prompts.
```js
const { prompt } = require('enquirer');
const question = [
{
type: 'input',
name: 'username',
message: 'What is your username?'
},
{
type: 'password',
name: 'password',
message: 'What is your password?'
}
];
let answers = await prompt(question);
console.log(answers);
```
**Prompts control how values are rendered and returned**
Each individual prompt is a class with special features and functionality for rendering the types of values you want to show users in the terminal, and subsequently returning the types of values you need to use in your application.
**How can I customize prompts?**
Below in this guide you will find information about creating [custom prompts](#-custom-prompts). For now, we'll focus on how to customize an existing prompt.
All of the individual [prompt classes](#built-in-prompts) in this library are exposed as static properties on Enquirer. This allows them to be used directly without using `enquirer.prompt()`.
Use this approach if you need to modify a prompt instance, or listen for events on the prompt.
**Example**
```js
const { Input } = require('enquirer');
const prompt = new Input({
name: 'username',
message: 'What is your username?'
});
prompt.run()
.then(answer => console.log('Username:', answer))
.catch(console.error);
```
### [Enquirer](index.js#L20)
Create an instance of `Enquirer`.
**Params**
* `options` **{Object}**: (optional) Options to use with all prompts.
* `answers` **{Object}**: (optional) Answers object to initialize with.
**Example**
```js
const Enquirer = require('enquirer');
const enquirer = new Enquirer();
```
### [register()](index.js#L42)
Register a custom prompt type.
**Params**
* `type` **{String}**
* `fn` **{Function|Prompt}**: `Prompt` class, or a function that returns a `Prompt` class.
* `returns` **{Object}**: Returns the Enquirer instance
**Example**
```js
const Enquirer = require('enquirer');
const enquirer = new E
没有合适的资源?快使用搜索试试~ 我知道了~
AGV调度系统的仿真平台源码+项目说明.zip
共2000个文件
js:1525个
md:289个
json:160个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 129 浏览量
2024-04-11
15:29:56
上传
评论
收藏 14.98MB ZIP 举报
温馨提示
AGV调度系统的仿真平台源码+项目说明.zipAGV调度系统的仿真平台源码+项目说明.zipAGV调度系统的仿真平台源码+项目说明.zipAGV调度系统的仿真平台源码+项目说明.zipAGV调度系统的仿真平台源码+项目说明.zipAGV调度系统的仿真平台源码+项目说明.zipAGV调度系统的仿真平台源码+项目说明.zipAGV调度系统的仿真平台源码+项目说明.zipAGV调度系统的仿真平台源码+项目说明.zipAGV调度系统的仿真平台源码+项目说明.zipAGV调度系统的仿真平台源码+项目说明.zipAGV调度系统的仿真平台源码+项目说明.zip 【资源说明】 1、该资源内项目代码都是经过测试运行成功,功能正常的情况下才上传的,请放心下载使用。 2、适用人群:主要针对计算机相关专业(如计科、信息安全、数据科学与大数据技术、人工智能、通信、物联网、数学、电子信息等)的同学或企业员工下载使用,具有较高的学习借鉴价值。 3、不仅适合小白学习实战练习,也可作为大作业、课程设计、毕设项目、初期项目立项演示等,欢迎下载,互相学习,共同进步!
资源推荐
资源详情
资源评论
收起资源包目录
AGV调度系统的仿真平台源码+项目说明.zip (2000个子文件)
mocha.css 5KB
mocha.css 3KB
index.html 88KB
unit-tests.html 12KB
speed-tests.html 4KB
index.html 3KB
index.html 606B
browser_amd.html 598B
browser.min.html 429B
browser.html 425B
browser.html 409B
testLoad.html 377B
testPersistence2.html 349B
testPersistence.html 298B
playground.html 169B
moment-with-locales.js 603KB
mocha.js 436KB
locales.js 434KB
moment-with-locales.min.js 361KB
locales.min.js 303KB
nedb.js 286KB
async.js 218KB
moment.js 170KB
moment.js 150KB
bytebuffer.js 150KB
bytebuffer-dataview.js 140KB
bytebuffer-node.js 140KB
chai.js 133KB
decimal.js 128KB
db.test.js 110KB
socket.io.js 105KB
nedb.min.js 97KB
localforage.js 94KB
mocha.js 94KB
jquery.min.js 94KB
localforage.js 91KB
require.js 84KB
localforage.nopromises.js 82KB
model.test.js 65KB
moment.min.js 57KB
modernizr.js 50KB
socket.io.msgpack.min.js 46KB
bytebuffer.min.js 44KB
typed-function.js 42KB
bytebuffer-dataview.min.js 41KB
underscore.js 40KB
socket.io.min.js 40KB
long.js 38KB
suite.js 37KB
indexeddb.js 36KB
index.js 36KB
_stream_readable.js 35KB
indexeddb.js 35KB
persistence.test.js 35KB
object_hash.js 34KB
avltree.test.js 33KB
socket.io.esm.min.js 33KB
long.js 32KB
bst.test.js 32KB
sbcs-data-generated.js 31KB
_stream_readable.js 31KB
localforage.min.js 29KB
cursor.test.js 28KB
indexes.test.js 27KB
response.js 26KB
logger.js 25KB
_stream_readable.js 25KB
file.js 25KB
model.js 25KB
localforage.nopromises.min.js 25KB
goog.math.long.js 24KB
datastore.js 23KB
index.js 23KB
FileStreamRotator.js 22KB
_stream_writable.js 21KB
dbcs-codec.js 21KB
async.min.js 21KB
index.js 21KB
fraction.js 21KB
bigfraction.js 20KB
_stream_writable.js 20KB
websql.js 20KB
index.js 19KB
file.js 19KB
ipaddr.js 19KB
logger.js 19KB
promise.js 19KB
index.js 18KB
websql.js 18KB
bytebuffer.js 17KB
localforage.js 17KB
conversions.js 16KB
socket.js 16KB
underscore.min.js 16KB
index.js 16KB
tests.js 15KB
index.js 15KB
index.js 15KB
conversion.test.js 15KB
fecha.umd.js 14KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
龙年行大运
- 粉丝: 1007
- 资源: 3848
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- Servlet和JDBC实现三层架构
- Appium-Inspector-2024.6.1-win
- Screenshot_2024-06-14-21-22-39-202_net.csdn.csdnplus.jpg
- Appium-Server-GUI-windows-1.22.3-4
- 基于C语言+python实现的永磁同步电机矢量控制算法仿真+源码(毕业设计&课程设计&项目开发)
- APKPure_v3.20.05_apkpure.com.apk
- HKJC_AOSBS_PROD_L2.7R2Q_Build8172.apk
- jetson官网下载的官方资料
- 小游戏的java程序开发
- matlab GUI仿真资源.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功