{"id":15646282,"url":"https://github.com/anc95/inquirer-file-tree-selection","last_synced_at":"2025-04-09T18:23:28.349Z","repository":{"id":34955828,"uuid":"193060120","full_name":"anc95/inquirer-file-tree-selection","owner":"anc95","description":"inquirer prompt for select a file or dir by file tree","archived":false,"fork":false,"pushed_at":"2023-06-13T14:56:30.000Z","size":3728,"stargazers_count":51,"open_issues_count":11,"forks_count":26,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-02T12:49:52.075Z","etag":null,"topics":["inquirer","inquirer-plugin","tree-selection"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anc95.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-06-21T08:22:06.000Z","updated_at":"2025-02-16T10:38:16.000Z","dependencies_parsed_at":"2024-06-18T13:59:51.090Z","dependency_job_id":"f491f1f7-4730-417a-aaab-bb3e40d3333c","html_url":"https://github.com/anc95/inquirer-file-tree-selection","commit_stats":{"total_commits":107,"total_committers":15,"mean_commits":7.133333333333334,"dds":0.383177570093458,"last_synced_commit":"d6d562b224632f73149f170c0cf335a1cc5af903"},"previous_names":[],"tags_count":33,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anc95%2Finquirer-file-tree-selection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anc95%2Finquirer-file-tree-selection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anc95%2Finquirer-file-tree-selection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anc95%2Finquirer-file-tree-selection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anc95","download_url":"https://codeload.github.com/anc95/inquirer-file-tree-selection/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248086048,"owners_count":21045261,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["inquirer","inquirer-plugin","tree-selection"],"created_at":"2024-10-03T12:12:13.160Z","updated_at":"2025-04-09T18:23:28.325Z","avatar_url":"https://github.com/anc95.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Inquirer File Tree Selection Prompt\n\n[![Node.js Package](https://github.com/anc95/inquirer-file-tree-selection/actions/workflows/npm-publish.yml/badge.svg)](https://github.com/anc95/inquirer-file-tree-selection/actions/workflows/npm-publish.yml)\n\n### QuickDemo\n![QuickDemo](./example/screenshot.gif)\n\n### Install\n```sh\nnpm install inquirer-file-tree-selection-prompt\n```\n\n\u003e If you are still using CJS, please install `inquirer-file-tree-selection-prompt@^1`\n\n### Usage\n```js\ninquirer.registerPrompt('file-tree-selection', inquirerFileTreeSelection)\n\ninquirer.prompt({\n  type: 'file-tree-selection',\n  ...\n})\n```\n\n### Options\nTakes `type`, `name`, `message`, [`filter`, `validate`, `transformer`, `default`, `pageSize`, `onlyShowDir`, `onlyShowValid`, `hideChildrenOfValid`, `root`, `hideRoot`, `multiple`, `enableGoUpperDirector`] properties.\n\nThe extra options that this plugin provides are:\n- `onlyShowDir`:  (Boolean) if true, will only show directory. Default: false.\n- `root`: (String) it is the root of file tree. Default: process.cwd(). \n- `onlyShowValid`: (Boolean) if true, will only show valid files (if `validate` is provided). Default: false.\n- `hideChildrenOfValid`: (Boolean) if true, will hide children of valid directories (if `validate` is provided). Default: false.\n- `transformer`: (Function) a hook function to transform the display of directory or file name.\n- `multiple`: (Boolean) if true, will enable to select multiple files. Default: false.\n- `enableGoUpperDirectory`: (Boolean) Show `..` in inside root dir, and the user can press **space** on it to go upper directory. Default: false.\n\nWhen `multiple` is enabled, `default` should be `string[]` type, otherwise it's `string` type.\n### Typescript Support\n\n\u003e version \u003e= 1.0.16\n\n1. Install `@types/inquirer`\n\n2. Ensure you have registered with `file-tree-selection`\n\n```js\ninquirer.registerPrompt('file-tree-selection', inquirerFileTreeSelection)\n```\n\n3. And you will get type support when you code in IDE\n\n![ts](./example/ts.jpeg)\n\n### Example\n\nESM (version ^2)\n\n```js\nimport inquirer from 'inquirer'\nimport inquirerFileTreeSelection from 'inquirer-file-tree-selection-prompt'\n\ninquirer.registerPrompt('file-tree-selection', inquirerFileTreeSelection)\n\ninquirer\n  .prompt([\n    {\n      type: 'file-tree-selection',\n      name: 'file'\n    }\n  ])\n  .then(answers =\u003e {\n    console.log(JSON.stringify(answers))\n  });\n```\n\nCJS (version ^1 and \u003c2)\n\n```js\nconst inquirer = require('inquirer')\nconst inquirerFileTreeSelection = require('inquirer-file-tree-selection-prompt')\n\ninquirer.registerPrompt('file-tree-selection', inquirerFileTreeSelection)\n\ninquirer\n  .prompt([\n    {\n      type: 'file-tree-selection',\n      name: 'file'\n    }\n  ])\n  .then(answers =\u003e {\n    console.log(JSON.stringify(answers))\n  });\n```\n\n[More examples](./example/)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanc95%2Finquirer-file-tree-selection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanc95%2Finquirer-file-tree-selection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanc95%2Finquirer-file-tree-selection/lists"}