
Security News
Vite Releases Technical Preview of Rolldown-Vite, a Rust-Based Bundler
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
inquirer-select-pro
Advanced tools
An inquirer select that supports multiple selections and filtering.
An inquirer select that supports multiple selections and filtering/searching.
pnpm i inquirer-select-pro
npm i inquirer-select-pro
npx @jeffwcx/gitignore
A CLI to generate a
.gitignore
file: @jeffwcx/gitignore.
import { select } from 'inquirer-select-pro';
const answer = await select({
message: 'select',
options: async (input) => {
const res = await fetch('<url>', {
body: new URLSearchParams({ keyword: input }),
});
if (!res.ok) throw new Error('fail to get list!');
return await res.json();
},
});
import { select } from 'inquirer-select-pro';
const answer = await select({
message: 'select...',
mutiple: false,
options: [
{ name: 'Apple', value: 'apple' },
{ name: 'Banana', value: 'banana' },
],
});
Clear the filter input when the option is selected (also causes the option list to change).
The first time you try the delete key, it will focus on the option to be deleted, and the second time it will remove the focused option.
import { select } from 'inquirer-select-pro';
const answer = await select({
message: 'select',
confirmDelete: true,
options: async (input) => {
const res = await fetch('<url>', {
body: new URLSearchParams({ keyword: input }),
});
if (!res.ok) throw new Error('fail to get list!');
return await res.json();
},
});
An inquirer select that supports multiple selections and filtering
config
SelectProps <Value, Multiple>CancelablePromise <Value>
import { select } from 'inquirer-select-pro';
const answer = await select({
message: 'select',
options: async (input) => {
const res = await fetch('<url>', {
body: new URLSearchParams({ keyword: input }),
});
if (!res.ok) throw new Error('fail to get list!');
return await res.json();
},
});
[!WARNING] This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
declare function useSelect<Value, Multiple extends boolean>(
props: UseSelectOptions<Value, Multiple>,
): UseSelectReturnValue<Value>;
props
UseSelectOptions<Value, Multiple>UseSelectReturnValue<Value>
export type SelectTheme = {
prefix: string;
spinner: {
interval: number;
frames: string[];
};
icon: {
checked: string;
unchecked: string;
cursor: string;
inputCursor: string;
};
style: {
answer: (text: string) => string;
message: (text: string) => string;
error: (text: string) => string;
help: (text: string) => string;
highlight: (text: string) => string;
key: (text: string) => string;
disabledOption: (text: string) => string;
renderSelectedOptions: <T>(
selectedOptions: ReadonlyArray<SelectOption<T>>,
allOptions: ReadonlyArray<SelectOption<T> | Separator>,
) => string;
emptyText: (text: string) => string;
placeholder: (text: string) => string;
};
helpMode: 'always' | 'never' | 'auto';
};
await renderPrompt({
message,
placeholder: 'search',
options: () => top100Films,
pageSize: 2,
instructions: false,
theme: {
icon: {
inputCursor: 'filter: ',
checked: ' √',
unchecked: ' ',
},
style: {
placeholder: (text: string) => `${text}...`,
},
},
});
The appearance is as follows:
? Choose movie:
filter: The Shawshank Redemption (1994)
> √ The Shawshank Redemption (1994)
The Godfather (1972)
Fork the project
Start development
git clone https://github.com/yourname/inquirer-select-pro.git
cd inquirer-select-pro
pnpm i
# Create a branch
git checkout -b my-new-feature
# Develop
pnpm dev
# Build
pnpm build
# Test
pnpm test
[!NOTE] Running
pnpm dev
actually allows you to specify the demo directly.
Here is a list of available demos:
pnpm dev filter-remote
Parameters can also be fixed. The following parameters can be fixed:
pnpm dev filter-demo --multiple=false
Commit changes to your branch git commit -am 'Add some feature'
Push your branch git push origin my-new-feature
Submit a pull request
FAQs
An inquirer select that supports multiple selections and filtering.
The npm package inquirer-select-pro receives a total of 12,856 weekly downloads. As such, inquirer-select-pro popularity was classified as popular.
We found that inquirer-select-pro demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
Research
Security News
A malicious npm typosquat uses remote commands to silently delete entire project directories after a single mistyped install.
Research
Security News
Malicious PyPI package semantic-types steals Solana private keys via transitive dependency installs using monkey patching and blockchain exfiltration.