{"size": 505, "ext": "js", "max_stars_repo_path": "cli.js", "max_stars_repo_name": "Richienb/website-popup-cli", "max_stars_repo_stars_event_min_datetime": "2016-05-11T08:04:50.000Z", "max_stars_repo_stars_event_max_datetime": "2022-01-15T02:29:56.000Z", "max_issues_repo_path": "cli.js", "max_issues_repo_name": "Richienb/website-popup-cli", "max_issues_repo_issues_event_min_datetime": "2021-02-18T14:59:26.000Z", "max_issues_repo_issues_event_max_datetime": "2021-02-18T14:59:26.000Z", "max_forks_repo_path": "cli.js", "max_forks_repo_name": "Richienb/website-popup-cli", "max_forks_repo_forks_event_min_datetime": "2016-10-27T12:35:53.000Z", "max_forks_repo_forks_event_max_datetime": "2021-04-05T18:10:57.000Z"}
{"max_stars_count": 26, "max_issues_count": 1, "max_forks_count": 6, "avg_line_length": 18.0357142857, "max_line_length": 58, "alphanum_fraction": 0.6475247525}
#!/usr/bin/env node
'use strict';
const meow = require('meow');
const websitePopup = require('website-popup');

const cli = meow(`
	Usage
	  $ website-popup <url> [--size=<size>]

	Example
	  $ website-popup https://sindresorhus.com --size=600x400
`);

if (cli.input.length === 0) {
	console.error('Specify a URL');
	process.exit(1);
}

const opts = {};

if (cli.flags.size) {
	const parts = cli.flags.size.split('x');
	opts.width = parts[0];
	opts.height = parts[1];
}

websitePopup(cli.input[0], opts);
