https://github.com/agrublev/fc-filepick
https://github.com/agrublev/fc-filepick
Last synced: 12 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/agrublev/fc-filepick
- Owner: agrublev
- Created: 2020-03-03T08:20:42.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-06-22T03:22:12.000Z (about 2 years ago)
- Last Synced: 2025-05-24T07:53:56.320Z (about 1 year ago)
- Language: JavaScript
- Size: 1.19 MB
- Stars: 4
- Watchers: 2
- Forks: 2
- Open Issues: 14
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*
- [FC-Filepick](#fc-filepick)
- [Installation](#installation)
- [Methods](#methods)
- [Options](#options)
- [Example](#example)
# FC-Filepick
A file picker made for node cli applications using enquirer.

## Installation
```bash
yarn add -D fc-filepick
```
## Methods
Select a directory
```js
const fcFilepicker = require("fc-filepick");
(async () => {
let dirLocation = await fcFilepicker();
console.info("Location of folder: ", dirLocation);
})();
```
Select a file
```js
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
```javascript
const fcFilepicker = require("fc-filepick");
fcFilepicker({ type: "file" }).then(location => {
console.info("Location of file: ", fileLocation);
});
```