// Name: Json To Yaml Converter // Author: Eduard Uffelmann // Twitter: @schmedu_ import "@johnlindquist/kit"; import * as yaml from "js-yaml"; let filePath = await getSelectedFile(); let content = await readJson(filePath); let result = yaml.dump(content); let todo = await mini("What to do?", ["Copy", "Save"]); if (todo === "Copy") { await copy(result); } else { await writeFile(filePath.replace(".json", ".yaml"), result); }