JSPM

  • Created
  • Published
  • Downloads 312947
  • Score
    100M100P100Q177065F
  • License MIT

TypeScript definitions for serve-favicon

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@types/serve-favicon) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    Installation

    npm install --save @types/serve-favicon

    Summary

    This package contains type definitions for serve-favicon (https://github.com/expressjs/serve-favicon).

    Details

    Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/serve-favicon.

    index.d.ts

    /* =================== USAGE ===================
    
        import serveFavicon = require('serve-favicon');
        app.use(serveFavicon(__dirname + '/public/favicon.ico'));
    
     =============================================== */
    
    import express = require("express");
    
    /**
     * Node.js middleware for serving a favicon.
     */
    declare function serveFavicon(
        path: string | Buffer,
        options?: serveFavicon.Options,
    ): express.RequestHandler;
    
    declare namespace serveFavicon {
        interface Options {
            /**
             * The cache-control max-age directive in ms, defaulting to 1 year.
             * This can also be a string accepted by the `ms` module.
             */
            maxAge?: number | string | undefined;
        }
    }
    
    export = serveFavicon;
    

    Additional Details

    • Last updated: Tue, 07 Nov 2023 15:11:36 GMT
    • Dependencies: @types/express

    Credits

    These definitions were written by Uros Smolnik, and Piotr Błażejewicz.