# koa-favicon

> favicon bounce middleware for koa

Latest version **2.1.0** (published 2020-02-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install koa-favicon
pnpm add koa-favicon
yarn add koa-favicon
bun add koa-favicon
```

## Health

**Score 23/100 (F)** — status: abandoned.

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.1.0 |
| Published | 2020-02-27 |
| First published | 2013-09-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/koa-favicon) |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 105 |
| Maintainers | aheckmann, coderhaoxin, dead_horse, eivifj, fengmk2, jongleberry, juliangruber, tjholowaychuk |
| Keywords | koa, middleware, favicon |

## Links

- npm: https://www.npmjs.com/package/koa-favicon
- Repository: https://github.com/koajs/favicon
- Homepage: https://github.com/koajs/favicon#readme
- Issues: https://github.com/koajs/favicon/issues
- npm.io page: https://npm.io/package/koa-favicon

## Dependencies (1)

- [mz](https://npm.io/package/mz.md) ^2.7.0

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 2.1.0 (latest) — 2020-02-27
- 2.0.0 (next) — 2016-02-27
- 2.0.1 — 2018-03-18
- 1.2.1 — 2016-02-27
- 1.2.0 — 2014-09-24
- 1.1.0 — 2014-05-05
- 1.0.1 — 2013-12-22
- 1.0.0 — 2013-09-14

## README

# koa-favicon [![Build Status](https://travis-ci.org/koajs/favicon.svg)](https://travis-ci.org/koajs/favicon)

 Koa middleware for serving a favicon. Based on [serve-favicon](https://github.com/expressjs/serve-favicon).

## Installation

```js
$ npm install koa-favicon
```

## Example

```js
const Koa = require('koa');
const favicon = require('koa-favicon');
const app = new Koa();

app.use(favicon(__dirname + '/public/favicon.ico'));
```

## API

### favicon(path, [options])

Returns a middleware serving the favicon found on the given `path`.

#### options

- `maxAge` cache-control max-age directive in ms, defaulting to 1 day.
- `mime` specify the mime-type of the favicon, defaults to "image/x-icon"

## License

  MIT

---
_Source: https://npm.io/package/koa-favicon · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
