@codenoobforreal/clitools
Version:
CLI tool for video processing (H.265/HEVC encoding & QuickTime compatibility) using FFmpeg, and batch lossless image compression with format preservation
78 lines • 2.27 kB
JavaScript
import { cancel, confirm, group, isCancel, select, text } from "@clack/prompts";
export async function askForVideoEncodeAnswer() {
return await group({
input: () => text({
message: "Enter input path",
placeholder: "Video path or a folder of videos",
defaultValue: ".",
}),
}, {
onCancel: () => {
cancel("Operation cancelled.");
process.exit(0);
},
});
}
export async function askForImageEncodeAnswer() {
return await group({
input: () => text({
message: "Enter input path",
placeholder: "Image path or a folder of images",
defaultValue: ".",
}),
}, {
onCancel: () => {
cancel("Operation cancelled.");
process.exit(0);
},
});
}
export async function askForHEVCEnableQuickTimeAnswer() {
return await group({
input: () => text({
message: "Enter input path",
placeholder: "Video path or a folder of videos",
defaultValue: ".",
}),
}, {
onCancel: () => {
cancel("Operation cancelled.");
process.exit(0);
},
});
}
export async function askForTask() {
const task = await select({
message: "Pick a task",
options: [
{
value: "video-encode",
label: "H.265 video encoding with recommended quality settings (batch available)",
},
{
value: "hevc-enable-QuickTime",
label: "Make QuickTime-incompatible HEVC videos playable without re-encoding (batch available)",
},
{
value: "image-encode",
label: "Lossless image encoding (batch available)",
},
],
});
if (isCancel(task)) {
cancel("Operation canceled");
process.exit(0);
}
return task;
}
export async function askForContinue() {
const shouldContinue = await confirm({
message: "Do you want to continue",
});
if (isCancel(shouldContinue)) {
cancel("Operation canceled");
process.exit(0);
}
return shouldContinue;
}
//# sourceMappingURL=prompt.js.map