Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

inquirer-file-path

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

inquirer-file-path

a file (relative to given path) selector for Inquirer.js

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7.9K
increased by20.83%
Maintainers
1
Weekly downloads
 
Created
Source

inquirer-file-path

Relative File Path prompt for inquirer

Build Status

Installation

npm install --save inquirer-file-path

Features

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

Key Maps

  • Press / key to enter search mode.
  • Use either up/down arrow keys or k/j to navigate
  • Use enter to select option

Usage

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

inquirer.registerPrompt('filePath', require('inquirer-file-path'));
inquirer.prompt({
  type: 'filePath',
  ...
})

Change filePath 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('filePath', require('inquirer-file-path'));
inquirer.prompt([{
  type: 'file',
  name: 'from',
  message: 'Where you like to put this component?',
  basePath: './src'
}]).then(function(answers) {
  // (answers.from is the path chosen)
});

See also example.js for a working example

Contributing

Unit test Unit test are written in Mocha. Please add a unit test for every new feature or bug fix. npm test to run the test suite.

Documentation Add documentation for every API change. Feel free to send typo fixes and better docs!

License

MIT

Acknowledgements

A huge thank you to Nick Randall and the other contributors of https://github.com/nicksrandall/inquirer-directory.

Future features

  • Add ability to config to filter options shown

Keywords

FAQs

Package last updated on 23 Mar 2018

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc