@rill/polyfill
v1.2.0
Published
Dynamic polyfill generator based on useragent for Rill.
Downloads
3
Maintainers
Readme
A small wrapper around polyfill-service which allows automatic user-agent based polyfills to be sent with Rill.
Installation
npm install @rill/polyfill
Example
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 test
to run tests.
Please feel free to create a PR!