Recursively check a website for broken links.
npx links-awakening 'https://styfle.dev'
Output
β
https://styfle.dev/
β
https://styfle.dev/projects
β
https://styfle.dev/blog
β
https://styfle.dev/contact
β
https://twitter.com/styfle
β
https://keybase.io/styfle
β
https://github.com/styfle
β
https://www.npmjs.com/~styfle
β
https://styfle.dev/blog/copee-released
β
http://googlechromereleases.blogspot.com/
β
https://developers.google.com/web/updates/
β
https://developers.google.com/web/updates/2015/04/cut-and-copy-commands
β http://zeroclipboard.org/ (status: 500, referer: https://styfle.dev/blog/copee-released)
β
http://styfle.github.io/copee/
β
https://styfle.dev/blog/d3js-graph-prod
β https://styfle.dev/slides/d3js.html (status: 404, referer: https://styfle.dev/blog/d3js-graph-prod)
import { awaken, type AwakenResult } from 'links-awakening';
const onAwaken = ({ url, status }: AwakenResult) => {
const icon = status >= 200 && status <= 299 ? 'β
' : 'β';
console.log(`${icon} ${url}`);
};
const url = new URL('https://example.com/blog');
const results = new Map<string, AwakenResult>();
await awaken({ url, onAwaken, results });
console.log(`Done! Crawled ${results.size} links.`);