An open API service indexing awesome lists of open source software.

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

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
```