Guide on Using basePath and match #21
-
Hello! First off, I want to say that this custom prompt looks super cool, and I'm excited to implement it in one of my own JS projects. However, being relatively new to JS development, I'm a bit confused with some of the parameters.
Thanks for creating a cool |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
nvm, I immediately found the answers 😅 Solutions
|
Beta Was this translation helpful? Give feedback.
nvm, I immediately found the answers 😅
Solutions
basePath
Use NodeJS's
os
andpath
packages. The former provides system utility methods, while the latter is all about PATHs. For example, if I wantinquirer-file-selector
to start onDocuments
no matter what Windows setup it's running on, it's:match
After looking at examples/recursive.js, there's an example that shows how to implement the param, Line 17.
So, to filter by file extension, simply use the code above and change the extension in the brackets.
Hopefully this helps anyone else with using this awesome prompt!