
Research
/Security News
9 Malicious NuGet Packages Deliver Time-Delayed Destructive Payloads
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.
@eliyya/inquirer-fs-selector
Advanced tools
An file or dir selector prompt implementation for Inquirer.js.

npm install inquirer-file-selector
import fileSelector from 'inquirer-file-selector'
const filePath = await fileSelector({
message: 'Select a file:',
...
})
| Option | Type | Required | Description |
|---|---|---|---|
message | string | ✔ | The message to display in the prompt. |
dir | boolena | ✔ | Allow select dir. |
path | string | The path to the directory where it will be started. Default: process.cwd() | |
pageSize | number | The maximum number of items to display in the list. Default: 10 | |
match | (file: Item) => boolean | A function to filter the files. If not provided, all files will be included. | |
hideNonMatch | boolean | If true, the list will be filtered to show only files that match the match function.Default: false | |
disabledLabel | string | The label to display when a file is disabled. Default: (not allowed) | |
allowCancel | boolean | If true, the prompt will allow the user to cancel the selection. Default: false | |
cancelText | string | The message to display when the user cancels the selection. Default: Canceled. | |
emptyText | string | The message that will be displayed when the directory is empty. Default: Directory is empty. | |
theme | See Theming | The theme to use for the file selector. | |
canceledLabel | string | Deprecated: Use cancelText instead. Will be removed in the next major version. | |
noFilesFound | string | Deprecated: Use emptyText instead. Will be removed in the next major version. |
You can theme a prompt by passing a theme object option. The theme object only need to includes the keys you wish to modify, we'll fallback on the defaults for the rest.
type FileSelectorTheme = {
icon: {
/**
* The prefix to use for the line.
* @default isLast => isLast ? └── : ├──
*/
linePrefix: (isLast: boolean) => string
}
style: {
/**
* The style to use for the disabled items.
* @default chalk.dim
*/
disabled: (text: string) => string
/**
* The style to use for the active item.
* @default chalk.cyan
*/
active: (text: string) => string
/**
* The style to use for the cancel text.
* @default chalk.red
*/
cancelText: (text: string) => string
/**
* Alias for `emptyText`.
* @deprecated Use `emptyText` instead. Will be removed in the next major version.
*/
noFilesFound?: (text: string) => string
/**
* The style to use for the empty text.
* @default chalk.red
*/
emptyText: (text: string) => string
/**
* The style to use for items of type directory.
* @default chalk.yellow
*/
directory: (text: string) => string
/**
* The style to use for items of type file.
* @default chalk.white
*/
file: (text: string) => string
/**
* The style to use for the current directory header.
* @default chalk.magenta
*/
currentDir: (text: string) => string
/**
* The style to use for the key bindings help.
* @default chalk.white
*/
help: (text: string) => string
/**
* The style to use for the keys in the key bindings help.
* @default chalk.cyan
*/
key: (text: string) => string
}
}
For examples look in the examples/ directory. You can execute the examples using node.
cd examples/
node <example-name>.js
[!NOTE] Before running the examples, make sure you have installed the dependencies with
npm installand compiled the project withnpm run build.
git checkout -b my-new-featuregit commit -am "feat: my new feature"git push origin my-new-feature[!NOTE] The commit message should follow the Conventional Commits specification.
© 2024 Brian Fernandez
This project is licensed under the MIT license. See the file LICENSE for details.
FAQs
Inquerer file selector prompt.
The npm package @eliyya/inquirer-fs-selector receives a total of 0 weekly downloads. As such, @eliyya/inquirer-fs-selector popularity was classified as not popular.
We found that @eliyya/inquirer-fs-selector demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.