anc95 / inquirer-file-tree-selection

inquirer prompt for select a file or dir by file tree
49 stars 26 forks source link

adds support for `transformer` property #8

Closed hogpilot closed 4 years ago

hogpilot commented 4 years ago

Fixes #7

This PR adds the capability for a user to specify a transform function. A use case where this would be useful is when the user would like to change the output (i.e. color) of the message via chalk methods, or perhaps add amplifying metadata about each file/folder (i.e. date modified).

Since the current way of knowing which row is selected relies on chalk.cyan, this new capability might make it difficult to know which row is active if the user overrides the color. Thus, this PR also adds a figures.play arrow to the selected row (when it is not a directory) as the prefix.