UNPKG

@lg-tools/crawler

Version:

Crawler for MongoDB documentation and other sites

11 lines (9 loc) 213 B
import chalk from 'chalk'; export const newURL = (href: string) => { try { return new URL(href); } catch (error) { console.error(chalk.red(`Invalid URL: ${href}`), error); process.exit(1); } };