Socket
Book a DemoInstallSign in
Socket

connect-favicons

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

connect-favicons

Serve site icons (favicon and apple-touch-icon(s)) quickly from any directory.

0.1.6
latest
Source
npmnpm
Version published
Weekly downloads
171
-41.44%
Maintainers
1
Weekly downloads
 
Created
Source

Connect Favicons

Serve site icons (favicon.ico and apple-touch-icon.png and all its flavours) quickly and from any directory.

Install

npm install --save git://github.com/theworkers/connect-favicons.git

Recognised icon filenames

  • favicon.ico
  • favicon.png
  • apple-touch-icon.png
  • apple-touch-icon-precomposed.png
  • apple-touch-icon-57x57.png
  • apple-touch-icon-57x57-precomposed.png
  • apple-touch-icon-72x72.png
  • apple-touch-icon-72x72-precomposed.png
  • apple-touch-icon-76x76.png
  • apple-touch-icon-76x76-precomposed.png
  • apple-touch-icon-114x114.png
  • apple-touch-icon-114x114-precomposed.png
  • apple-touch-icon-120x120.png
  • apple-touch-icon-120x120-precomposed.png
  • apple-touch-icon-144x144.png
  • apple-touch-icon-144x144-precomposed.png
  • apple-touch-icon-152x152.png
  • apple-touch-icon-152x152-precomposed.png
  • apple-touch-icon-180x180.png
  • apple-touch-icon-180x180-precomposed.png
  • favicon-16x16.png
  • favicon-32x32.png
  • favicon-128x128.png
  • favicon-256x256.png
  • mstile-150x150.png
  • safari-pinned-tab.svg

Usage

Add connect-favicons to your middleware stack before everything else. The whole point here is to serve favicon.ico and apple-touch-icon.png (et al.) quickly, without involving any routing.

In this case, you may have all your site icons, including favicon.ico in /public/img/icons:

app.use(favicons(__dirname + '/public/img/icons'));

Now any request to the example.com/favicon.ico or example.com/apple-touch-icon.png will be served by Connect Favicons, reading from the folder you specified.

Example

var http     = require('http');
var path     = require('path');
var express  = require('express');
var favicons = require('connect-favicons');

var app = express();

// Middleware stack
app.use(favicons(__dirname + '/public/img/icons'));
app.use(express.static(path.join(__dirname, '/public')));

http.createServer(app).listen(3000, function(){
    console.log("Express server listening on port " + 3000);
});

Keywords

favicon

FAQs

Package last updated on 13 Dec 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.