fc-filepick
v1.3.0
Published
File Picker for Command Line Applications using enquirer
Downloads
83
Maintainers
Readme
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);
});