1.2.0 • Published 8 years ago
@rill/polyfill v1.2.0
A small wrapper around polyfill-service which allows automatic user-agent based polyfills to be sent with Rill.
Installation
npm install @rill/polyfillExample
const app = require('rill')()
const polyfill = require('@rill/polyfill')
// Setup route to send the polyfill.
app.get('/polyfill.js.min', polyfill({ minify: true }))In the browser
<script src="/polyfill.js.min"></script>API Options/Defaults
{
// The cache time for the polyfill file (string or number of seconds).
maxage: '1 year',
// Enable or disable minification.
minify: true,
// Enable or disable polyfilling unknown user agents.
unknown: true,
// Array of excluded features.
excludes: undefined,
// Object containing the features to pollyfill (defaults to all).
features: undefined
}For a list of polyfills and more documentation click here
Contributions
- Use
npm testto run tests.
Please feel free to create a PR!