
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-path
Advanced tools
This project provides a path
prompt for the Inquirer module. It allows the user to pick a path using a similar interface as zsh.
Install the module using npm install inquirer-path
.
Create a question just as you would with any other Inquirer question types. Once included, the module registers itself with the resolved inquirer
instance. If you want to register it under another question type or if you are using a different inquirer instance, you should include:
import { PathPrompt } from 'inquirer-path';
inquirer.prompt.registerPrompt('path', PathPrompt);
If the question's multi
property is set to true, the prompt will indefinitely ask for more paths. In order to finalize the answer, the user must either send a SIGINT or hit the escape key. The last answer is discarded when the user exits the prompt
The path question supports the following options:
path
in order to use this module.SIGINT
signal (ctrl+C)import inquirer from ('inquirer');
import { PathPrompt } from 'inquirer-path';
const questions = [{
type: 'path',
name: 'path',
message: 'Enter a path',
default: process.cwd(),
}];
inquirer.registerPrompt('path', PathPrompt);
inquirer.prompt(questions)
.then((result) => console.log(result.path));
You can see additional examples in the examples folder.
The API documentation can be found here
This project defines the following npm
scripts to help you during development:
compile
- Compile the code in ./src
and output it into ./lib
compile-watch
- Watch the ./src
folder. When a change occurs, the code is recompiled and the docs are regenerated.lint
- Run eslint to validate the code formattingfix-lint
- Fix the simple eslint errordocs
- Generate the html documentation to ./docs
docs-watch
- Create a documentation server at localhost:4001docs-md
- Generate the DOCUMENTATION.md fileThis project is a real pain to debug. Using console.log
messes up the UI (and is often overriden by it) and the Webstorm debugger does not play nice with user input. The best way I have found so far is to use console.error
and redirect the error stream to a file. I have one terminal in which I run node yourscript.js 2> debug.txt
and another in which I observe the output using tail -f debug.txt
. I'm definitely opened to better suggestions.
FAQs
An Inquirer extension to support path questions
The npm package inquirer-path receives a total of 2,808 weekly downloads. As such, inquirer-path popularity was classified as popular.
We found that inquirer-path demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.