@rill/polyfill

1.2.0 • Public • Published

Rill
@rill/polyfill
API stability Standard NPM version Downloads Gitter Chat

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!

Package Sidebar

Install

npm i @rill/polyfill

Weekly Downloads

0

Version

1.2.0

License

MIT

Last publish

Collaborators

  • dylanpiercey