2.0.0 • Published 9 years ago

derby-detect-webp v2.0.0

Weekly downloads
4
License
MIT
Repository
github
Last release
9 years ago

Derby Detect Webp

Webp feature detection for Derby JS.

Installation

npm install derby-detect-webp --save

Usage

Add the middleware:

var app = derby.createApp('...', __filename);
app.serverUse(module, 'derby-detect-webp');

Check if webp is supported:

app.get('*', function (page, model, params, next) {
  var hasWebp = model.get('$feature.webp');
  if (hasWebp) return page.render();
  next();
});

Options

path - Specify the path to set webp data. Defaults to $feature.webp.