New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

express-blinker

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

express-blinker

Middleware to serve static files with proper cache headers.

  • 0.0.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
15
increased by1400%
Maintainers
1
Weekly downloads
 
Created
Source

Blinker, because your site needs speed.

"Blinker" is actually a german word and it reffers to that blinking light on a car or motorcycle with which you indicate which direction you are going to take. And that is what thi smodule does; you tell it how to cache, and it will direct your browser!

Install

npm install express-blinker

Usage

var express = require("express"),
    app = express(),
    blinker = require("express-blinker"),
    path = require("path"),
    basePath = path.join(__dirname, "public");

app.use(blinker(basePath, [
    {
        test: /.*/,
        etag: true,
        lastModified: false,
        cacheControl: true,
        expires: false,
        age: 600
    }
]));

app.listen(1234);

blinker(basePath, options)

  • basePath: This is the full path to your resources that you want to deliver.
  • options: This is an object. You must specify all options. This ensures no unexpected behaviour.
    • options.test: This is a regular expression that is used to see which of your configuration objects should be used. You could use this to pick up files based on their extension or naming.
    • options.etag: Wether to do ETagging.
    • options.lastModified: Wether the browser a Last-Modified header.
    • options.cacheControl: Wether to generate and send a Cache-Control header.
    • options.cacheKeyword: Used when generating a Cache-Control header.
    • option.expires: Wether to send an Expires header.
    • options.age: This is very required. Specify the cache time in seconds.

Keywords

FAQs

Package last updated on 24 Dec 2015

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc