1. inquirer-directory
a directory (relative to given path) selector for Inquirer.js
inquirer-directory
Package: inquirer-directory
Created by: nicksrandall
Last modified: Sun, 19 Jun 2022 01:28:03 GMT
Version: 2.2.0
License: MIT
Downloads: 192,339
Repository: https://github.com/nicksrandall/inquierer-directory

Install

npm install inquirer-directory
yarn add inquirer-directory

inquirer-directory

Relative Directory prompt for inquirer

Build Status

Installation

npm install --save inquirer-directory

Features

  • Support for symlinked files
  • Vim style navigation
  • Search for file with "/" key

Key Maps

  • Press "/" key to enter search mode.
  • Press "-" key to go up (back) a directory.

Usage

This prompt is anonymous, meaning you can register this prompt with the type name you please:

 inquirer.registerPrompt('directory', require('inquirer-directory'));
inquirer.prompt({
  type: 'directory',
  ...
})

Change directory to whatever you might prefer.

Options

Takes type, name, message, basePath properties.

See inquirer readme for meaning of all except basePath.

basePath is the relative path from your current working directory

Example

 inquirer.registerPrompt('directory', require('inquirer-directory'));
inquirer.prompt([{
  type: 'directory',
  name: 'from',
  message: 'Where you like to put this component?',
  basePath: './src'
}]).then(function(answers) {
  // (answers.from is the path chosen)
});

asciicast

See also example.js for a working example

License

MIT

RELATED POST

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin