Table of Contents generated with DocToc
A file picker made for node cli applications using enquirer.
yarn add -D fc-filepick
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);
})();
- 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: '.'.
const fcFilepicker = require("fc-filepick");
fcFilepicker({ type: "file" }).then(location => {
console.info("Location of file: ", fileLocation);
});