derby-detect-webp
v2.0.0
Published
Webp feature detection for Derby JS.
Downloads
2
Maintainers
Readme
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.