Socket
Book a DemoInstallSign in
Socket

@pega/inquirer-fuzzy-path

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

@pega/inquirer-fuzzy-path

Fuzzy file/directory search and select prompt for inquirer.

latest
npmnpm
Version
3.0.0
Version published
Maintainers
0
Created
Source

@pega/inquirer-fuzzy-path

Overview

This @pega project is based upon fuzzy-path found here: https://www.npmjs.com/package/inquirer-fuzzy-path

Fuzzy path works with npm inquirer to help when typing in paths.

Fuzzy file/directory search and select prompt for Inquirer.js

inquirer-fuzzy-path demo

Project has been modified:

  • fixed bugs
  • updated dependenices
  • updated to module to be used in modules
  • internal for Pegasystems usage (according to MIT license)

Teams responsible

  • Sprockets
  • Torque

Usage

Register the prompt with inquirer:

inquirer.registerPrompt('fuzzypath', require('inquirer-fuzzy-path'))

Call the prompt:

  return inquirer.prompt([
    {
      type: 'fuzzypath',
      name: 'path',
      excludePath: nodePath => nodePath.startsWith('node_modules'),
        // excludePath :: (String) -> Bool
        // excludePath to exclude some paths from the file-system scan
      excludeFilter: nodePath => nodePath == '.',
        // excludeFilter :: (String) -> Bool
        // excludeFilter to exclude some paths from the final list, e.g. '.'
      itemType: 'any',
        // itemType :: 'any' | 'directory' | 'file'
        // specify the type of nodes to display
        // default value: 'any'
        // example: itemType: 'file' - hides directories from the item list
      rootPath: 'app',
        // rootPath :: String
        // Root search directory
      message: 'Select a target directory for your component:',
      default: 'components/',
      suggestOnly: false,
        // suggestOnly :: Bool
        // Restrict prompt answer to available choices or use them as suggestions
      depthLimit: 5,
        // depthLimit :: integer >= 0
        // Limit the depth of sub-folders to scan
        // Defaults to infinite depth if undefined
    }
  ]);

Change log

  • In version 3.0.0 brought in @pega and fixed search crash with defaults for choice values Based upon:
    • In version 2.2.0 new option excludeFilter was added.
    • In version 2.1.0 new option depthLimit was added.
    • In version 2.0.0 option filterPath was deprecated. Please use excludePath and itemType instead.
  • inquirer - A collection of common interactive command line user interfaces

License

MIT © adelsz

Keywords

pega

FAQs

Package last updated on 21 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