inquirer-filefolder-prompt
v0.0.1
Published
File/folder prompt for Inquirer.js
Downloads
4
Maintainers
Readme
inquirer-filefolder-prompt
BETA VERSION! UNDER DEVELOPEMENT!
File/folder prompt for Inquirer.js.
Based on file-folder-dialogs.
Installation
npm install --save inquirer-filefolder-prompt
Usage
This prompt is anonymous, meaning you can register this prompt with the type name you please:
inquirer.registerPrompt('filefolder', require('inquirer-filefolder-prompt'));
inquirer.prompt({
type: 'filefolder',
...
})
Change name: 'file'
to whatever you might prefer.
Options
Coming soon...
Example
inquirer.registerPrompt('filefolder', require('inquirer-filefolder-prompt'));
inquirer.prompt({
type: 'filefolder',
name: 'file',
message: 'Please select the file.',
dialog: {
type: 'OpenFileDialog',
config: {
'title': 'Open',
//...
},
},
validate: function(file) {
if (file.length === 0) {
return 'No file selected.';
}
return true;
}
}).then(answers => {
console.log(JSON.stringify(answers, null, ' '));
});
See also the examples folder.
License
MIT © Zsombor Franczia