{"_id":"@eliyya/inquirer-fs-selector","name":"@eliyya/inquirer-fs-selector","dist-tags":{"latest":"0.3.2"},"versions":{"0.3.2":{"name":"@eliyya/inquirer-fs-selector","author":{"name":"Brian Fernandez"},"description":"Inquerer file selector prompt.","version":"0.3.2","license":"MIT","type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","scripts":{"lint":"biome lint","lint:fix":"biome check --write","prebuild":"npm run lint","build":"tsup --config ./tsup.config.json"},"dependencies":{"@inquirer/core":"^9.0.10","@inquirer/figures":"^1.0.5","chalk":"^5.3.0"},"devDependencies":{"@biomejs/biome":"1.8.3","@inquirer/select":"2.4.7","@inquirer/type":"1.5.2","@tsconfig/node18":"18.2.4","tsup":"8.2.4","typescript":"5.2.2"},"engines":{"node":">=18"},"repository":{"type":"git","url":"git+https://github.com/eliyya/inquirer-fs-selector.git"},"bugs":{"url":"https://github.com/eliyya/inquirer-fs-selector/issues"},"homepage":"https://github.com/eliyya/inquirer-fs-selector#readme","keywords":["inquirer","file","selector"],"_id":"@eliyya/inquirer-fs-selector@0.3.2","gitHead":"ae19b5c6b92a39d513d82cbe0cd5abb47100b3d3","_nodeVersion":"20.17.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-jN/0gQkweopzuxy0clMXygG2RyqrVglqgshjlrX/3mNNOV3AgGpLfC0ap/dD0EfqpC2BhGkxwLWCVhmJFhYwLQ==","shasum":"4af607707ad5072c14d8535d45f27752250beafd","tarball":"https://registry.npmjs.org/@eliyya/inquirer-fs-selector/-/inquirer-fs-selector-0.3.2.tgz","fileCount":5,"unpackedSize":15043,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC4wIvJh84OtYf5bTgBUCBKSmM/djEu8aOQcu9K0Z+GdwIgFtVETGDsiJE0Uhj0VZkvweojXVbDY+nbHKzt9Xndw7Y="}]},"_npmUser":{"name":"eliyya","email":"elimacmun@gmail.com"},"directories":{},"maintainers":[{"name":"eliyya","email":"elimacmun@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/inquirer-fs-selector_0.3.2_1724542902009_0.25069579554625476"},"_hasShrinkwrap":false}},"time":{"created":"2024-08-24T23:41:41.900Z","0.3.2":"2024-08-24T23:41:42.165Z","modified":"2024-08-24T23:41:42.399Z"},"maintainers":[{"name":"eliyya","email":"elimacmun@gmail.com"}],"description":"Inquerer file selector prompt.","homepage":"https://github.com/eliyya/inquirer-fs-selector#readme","keywords":["inquirer","file","selector"],"repository":{"type":"git","url":"git+https://github.com/eliyya/inquirer-fs-selector.git"},"author":{"name":"Brian Fernandez"},"bugs":{"url":"https://github.com/eliyya/inquirer-fs-selector/issues"},"license":"MIT","readme":"<h1 align=\"center\">\r\n  inquirer-fs-selector\r\n</h1>\r\n\r\n<p align=\"center\">\r\n  An file or dir selector prompt implementation for <a href=\"https://github.com/SBoudrias/Inquirer.js\">Inquirer.js</a>.\r\n</p>\r\n\r\n<div align=\"center\">\r\n\r\n  ![license](https://img.shields.io/npm/l/inquirer-file-selector)\r\n  ![node-current](https://img.shields.io/node/v/inquirer-file-selector?color=darkgreen)\r\n  ![version](https://img.shields.io/npm/v/inquirer-file-selector?color=orange)\r\n  ![unpacked-size](https://img.shields.io/npm/unpacked-size/inquirer-file-selector)\r\n  ![downloads](https://img.shields.io/npm/dt/inquirer-file-selector.svg)\r\n\r\n  ![preview](https://github.com/br14n-sol/inquirer-file-selector/blob/main/preview.gif?raw=true)\r\n\r\n</div>\r\n\r\n## Installation\r\n\r\n```shell\r\nnpm install inquirer-file-selector\r\n```\r\n\r\n## Usage\r\n\r\n```ts\r\nimport fileSelector from 'inquirer-file-selector'\r\n\r\nconst filePath = await fileSelector({\r\n  message: 'Select a file:',\r\n  ...\r\n})\r\n```\r\n\r\n## Options\r\n\r\n| Option | Type | Required | Description |\r\n|--------|------|----------|-------------|\r\n| `message` | `string` | ✔ | The message to display in the prompt. |\r\n| `dir` | `boolena` | ✔ | Allow select dir. |\r\n| `path` | `string` | | The path to the directory where it will be started.<br/> **Default**: `process.cwd()` |\r\n| `pageSize` | `number` | | The maximum number of items to display in the list.<br/> **Default**: `10` |\r\n| `match` | `(file: Item) => boolean` | | A function to filter the files.<br/> If not provided, all files will be included. |\r\n| `hideNonMatch` | `boolean` | | If true, the list will be filtered to show only files that match the `match` function.<br/> **Default**: `false` |\r\n| `disabledLabel` | `string` | | The label to display when a file is disabled.<br/> **Default**: ` (not allowed)` |\r\n| `allowCancel` | `boolean` | | If true, the prompt will allow the user to cancel the selection.<br/> **Default**: `false` |\r\n| `cancelText` | `string` | | The message to display when the user cancels the selection.<br/> **Default**: `Canceled.` |\r\n| `emptyText` | `string` | | The message that will be displayed when the directory is empty.<br/> **Default**: `Directory is empty.` |\r\n| `theme` | [See Theming](#theming) | | The theme to use for the file selector. |\r\n| ~~`canceledLabel`~~ | ~~`string`~~ | | **Deprecated**: Use `cancelText` instead. Will be removed in the next major version. |\r\n| ~~`noFilesFound`~~ | ~~`string`~~ | | **Deprecated**: Use `emptyText` instead. Will be removed in the next major version. |\r\n\r\n## Theming\r\n\r\nYou 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.\r\n\r\n```ts\r\ntype FileSelectorTheme = {\r\n  icon: {\r\n    /**\r\n     * The prefix to use for the line.\r\n     * @default isLast => isLast ? └── : ├──\r\n     */\r\n    linePrefix: (isLast: boolean) => string\r\n  }\r\n  style: {\r\n    /**\r\n     * The style to use for the disabled items.\r\n     * @default chalk.dim\r\n     */\r\n    disabled: (text: string) => string\r\n    /**\r\n     * The style to use for the active item.\r\n     * @default chalk.cyan\r\n     */\r\n    active: (text: string) => string\r\n    /**\r\n     * The style to use for the cancel text.\r\n     * @default chalk.red\r\n     */\r\n    cancelText: (text: string) => string\r\n    /**\r\n     * Alias for `emptyText`.\r\n     * @deprecated Use `emptyText` instead. Will be removed in the next major version.\r\n     */\r\n    noFilesFound?: (text: string) => string\r\n    /**\r\n     * The style to use for the empty text.\r\n     * @default chalk.red\r\n     */\r\n    emptyText: (text: string) => string\r\n    /**\r\n     * The style to use for items of type directory.\r\n     * @default chalk.yellow\r\n     */\r\n    directory: (text: string) => string\r\n    /**\r\n     * The style to use for items of type file.\r\n     * @default chalk.white\r\n     */\r\n    file: (text: string) => string\r\n    /**\r\n     * The style to use for the current directory header.\r\n     * @default chalk.magenta\r\n     */\r\n    currentDir: (text: string) => string\r\n    /**\r\n     * The style to use for the key bindings help.\r\n     * @default chalk.white\r\n     */\r\n    help: (text: string) => string\r\n    /**\r\n     * The style to use for the keys in the key bindings help.\r\n     * @default chalk.cyan\r\n     */\r\n    key: (text: string) => string\r\n  }\r\n}\r\n```\r\n\r\n## Examples\r\n\r\nFor examples look in the examples/ directory. You can execute the examples using node.\r\n\r\n```shell\r\ncd examples/\r\nnode <example-name>.js\r\n```\r\n\r\n> [!NOTE]\r\n> Before running the examples, make sure you have installed the dependencies with `npm install` and compiled the project with `npm run build`.\r\n\r\n## Contributing\r\n\r\n1. Fork it!\r\n2. Create your feature branch: `git checkout -b my-new-feature`\r\n3. Commit your changes: `git commit -am \"feat: my new feature\"`\r\n4. Push to the branch: `git push origin my-new-feature`\r\n5. Submit a pull request :D\r\n\r\n> [!NOTE]\r\n> The commit message should follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification.\r\n\r\n## Copyright & License\r\n\r\n© 2024 [Brian Fernandez](https://github.com/br14n-sol)\r\n\r\nThis project is licensed under the MIT license. See the file [LICENSE](LICENSE) for details.","readmeFilename":"README.md"}