Wondering what’s next for npm?Check out our public roadmap! »

    koa-favicon
    DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/koa-favicon package

    2.1.0 • Public • Published

    koa-favicon Build Status

    Koa middleware for serving a favicon. Based on serve-favicon.

    Installation

    $ npm install koa-favicon

    Example

    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

    Install

    npm i koa-favicon

    DownloadsWeekly Downloads

    70,295

    Version

    2.1.0

    License

    MIT

    Unpacked Size

    3.06 kB

    Total Files

    4

    Last publish

    Collaborators

    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar