How to use capture-website - 3 common examples

To help you get started, we’ve selected a few capture-website examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sindresorhus / capture-website-cli / cli.js View on Github external
}

	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));
	}
})();
github sindresorhus / capture-website-cli / cli.js View on Github external
(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 {
github sindresorhus / capture-website-cli / cli.js View on Github external
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));
	}
})();

capture-website

Capture screenshots of websites

MIT
Latest version published 9 months ago

Package Health Score

63 / 100
Full package analysis