New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

inquirer-honshin-select

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

inquirer-honshin-select

Inquirer prompt that lets you choose an item from a list and choose an action to take by pressing a key.

latest
Source
npmnpm
Version
0.0.4
Version published
Weekly downloads
92
-50.27%
Maintainers
0
Weekly downloads
 
Created
Source

inquirer-honshin-select

Inquirer prompt that lets you choose an item from a list and choose an action to take by pressing a key.

This project is a fork from: inquirer-action-select.

This project is pure JavaScript and in ES module.

Installation

npm i inquirer-honshin-select

Usage

const answer = await actionSelect({
    message: 'Choose a file',
    actions: [
        { value: 'open', name: 'Open', key: 'o' },
        { value: 'edit', name: 'Edit', key: 'e' },
        { value: 'delete', name: 'Delete', key: 'x' }
    ],
    choices: [
        { value: 'image.png', name: 'image.png' },
        { value: 'audio.mp3', name: 'audio.mp3' },
        { value: 'code.py',  name: 'code.py' }
    ]
)
? Choose a file Open <O> Edit <E> Delete <X>
❯ image.png
  audio.mp3
  code.py

Options

PropertyTypeRequiredDescription
messagestringyesThe question to ask
actionsArray<{ value: T, name?: string, key: string }>yesList of actions the user can take on the selected choice. name is the name of the action displayed on the prompt. value is what will be returned from the prompt. key is the key the user will press to take the specified action.
choicesArray<{ value: T, name?: string, description?: string, disabled?: boolean | string } | Separator>yesList of the available choices. The value will be returned as the answer, and used as display if no name is defined. Choices who're disabled will be displayed, but not selectable. The description will be displayed under the prompt when the cursor land over the choice.
defaultstringnoDefines in front of which item the cursor will initially appear. When omitted, the cursor will appear on the first selectable item.
pageSizenumbernoBy default, lists of choice longer than 7 will be paginated. Use this option to control how many choices will appear on the screen at once.
loopbooleannoDefaults to true. When set to false, the cursor will be constrained to the top and bottom of the choice list without looping.
themeSee Theming in Select docs.noCustomize look of the prompt.

Returns

PropertyTypeDescription
actionTvalue specified for the selected action
answerTvalue specified for the selected choice

FAQs

Package last updated on 31 Jan 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts