@dwmkerr/inquirer-advanced-input-prompt
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

inquirer-advanced-input-prompt

cicd npm (scoped) codecov

An input prompt implementation for Inquirer that provides some advanced features.

Out of the box, this prompt works just like the input prompt.

This is work in progress - I'm using it to improve the user experience of Terminal AI. Things may not work as expected. When the API stabalises and is well-tested then the demo will be updated and linked back to the original project.

Installation

npm install @dwmkerr/advanced-input-prompt

Features

The hint parameter shows a hint below the input prompt. As soon as the user starts typing, the hint is hidden:

Usage

import prompt from "./advanced-input-prompt";

async function demo() {
  const answer = await prompt({
    message: "Enter your input (required):",
    hint: "<Enter> Show Menu",
    required: true,
    validate: (input: string) => input.trim() !== "" || "Input cannot be empty",
  });
  console.log(`User input: ${answer1}`);
}

(async () => {
  await demo();
})();

Developer Guide

Clone the repo, install dependencies and use npm start to run the demo:

git clone git@github.com:dwmkerr/inquirer-advanced-input-prompt
cd inquirer-advanced-input-prompt
npm install
npm start

Package Sidebar

Install

npm i @dwmkerr/inquirer-advanced-input-prompt

Weekly Downloads

23

Version

0.1.0

License

MIT

Unpacked Size

12.9 kB

Total Files

10

Last publish

Collaborators

  • dwmkerr-admin