Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
if (!input) {
input = await getStdin();
options.inputType = 'html';
}
if (!input) {
console.error('Please specify a URL, file path or HTML');
process.exit(1);
}
if (output) {
await captureWebsite.file(input, output, options);
} else {
process.stdout.write(await captureWebsite.buffer(input, options));
}
})();
(async () => {
const {
internalPrintFlags,
listDevices,
output
} = options;
if (internalPrintFlags) {
console.log(JSON.stringify(options));
return;
}
if (listDevices) {
console.log(captureWebsite.devices.join('\n'));
return;
}
if (!input) {
input = await getStdin();
options.inputType = 'html';
}
if (!input) {
console.error('Please specify a URL, file path or HTML');
process.exit(1);
}
if (output) {
await captureWebsite.file(input, output, options);
} else {
console.log(captureWebsite.devices.join('\n'));
return;
}
if (!input) {
input = await getStdin();
options.inputType = 'html';
}
if (!input) {
console.error('Please specify a URL, file path or HTML');
process.exit(1);
}
if (output) {
await captureWebsite.file(input, output, options);
} else {
process.stdout.write(await captureWebsite.buffer(input, options));
}
})();