Function FileConverterPrompt

  • Prompts the user to select files for conversion and then converts them to the specified format.

    This function first searches for files in the current working directory that match the toExt extension. It then presents the user with a checkbox prompt to select which files they want to convert. After the user makes their selection, the function iterates through the selected files, reads their content based on the fromExt extension, converts the content to the toExt format, and writes the converted content to a new file with the updated extension.

    Parameters

    • fromExt: string

      The original file extension (e.g., '.yaml', '.csv', '.json').

    • toExt: string

      The target file extension to convert to (e.g., '.csv', '.yaml', '.json').

    Returns Promise<void>

    FileConverterPrompt('.yaml', '.csv') // Convert all selected .yaml files to .csv