fc-filepick

1.0.4 • Public • Published

Table of Contents generated with DocToc

FC-Filepick

A file picker made for node cli applications using enquirer.

Installation

yarn add -D fc-filepick

Methods

Select a directory

const fcFilepicker = require("fc-filepick");

(async () => {
  let dirLocation = await fcFilepicker();
  console.info("Location of folder: ", dirLocation);
})();

Select a file

const fcFilepicker = require("fc-filepick");

(async () => {
  let fileLocation = await fcFilepicker({ type: "file" });
  console.info("Location of file: ", fileLocation);
})();

Options

  • question (string) Show the question for select the file. Default: 'Choose a file/folder'.
  • type (string) folder/file select a folder or file . Default: 'folder'.
  • folder (string) Starting location of search. Default: '.'.

Example

const fcFilepicker = require("fc-filepick");

fcFilepicker({ type: "file" }).then(location => {
  console.info("Location of file: ", fileLocation);
});

Package Sidebar

Install

npm i fc-filepick

Weekly Downloads

67

Version

1.0.4

License

ISC

Unpacked Size

117 kB

Total Files

3

Last publish

Collaborators

  • agrublev