https://github.com/victrme/favicon-fetcher
Favicon fetcher finds favicons and flawlessly fetches them fast
https://github.com/victrme/favicon-fetcher
api cloudflare-workers favicon favicon-grabber
Last synced: 6 months ago
JSON representation
Favicon fetcher finds favicons and flawlessly fetches them fast
- Host: GitHub
- URL: https://github.com/victrme/favicon-fetcher
- Owner: victrme
- License: unlicense
- Created: 2023-02-24T09:47:04.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-02-27T07:30:12.000Z (8 months ago)
- Last Synced: 2025-03-23T19:11:27.692Z (7 months ago)
- Topics: api, cloudflare-workers, favicon, favicon-grabber
- Language: TypeScript
- Homepage: https://favicon.victr.me
- Size: 817 KB
- Stars: 22
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# favicon fetcher
Favicon fetcher finds sites favicons and fetches them fast
Test it here: https://favicon.victr.me
## Install
```bash
npm i @victr/favicon-fetcher
```### Example use
```js
import favicon from '@victr/favicon-fetcher'window.onload = async function () {
const img = document.getElementById('some-id')
const url = await favicon.url('https://github.com')img.src = url
}
```### Export type
```ts
export default {
url: (query: string) => Promise,
img: (query: string) => Promise,
}
```## As API
### Endpoints
Protocols need to be included in the `:url` query. You can get your favicon as a plaintext url or a blob:
```HTTP
GET /text/:url
``````HTTP
GET /blob/:url
```### Cloudflare Workers
```bash
# install
pnpm install# debug
pnpm dev
```