Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/styfle/links-awakening
🔗 Recursively check a website for broken links
https://github.com/styfle/links-awakening
broken-links check-links dead-links hacktoberfest hyperlinks
Last synced: 12 days ago
JSON representation
🔗 Recursively check a website for broken links
- Host: GitHub
- URL: https://github.com/styfle/links-awakening
- Owner: styfle
- Created: 2022-12-14T00:09:02.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-09-04T12:58:37.000Z (about 1 year ago)
- Last Synced: 2024-10-23T06:07:48.126Z (20 days ago)
- Topics: broken-links, check-links, dead-links, hacktoberfest, hyperlinks
- Language: TypeScript
- Homepage:
- Size: 90.8 KB
- Stars: 132
- Watchers: 4
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
Links Awakening
Recursively check a website for broken links.
## Usage
```sh
npx links-awakening 'https://styfle.dev'
```Output
```sh
✅ 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)
```### Programmatic API
```ts
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();
await awaken({ url, onAwaken, results });
console.log(`Done! Crawled ${results.size} links.`);
```