Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/pearofducks/koa-polyfill

middleware to provide dynamic polyfills - based on polyfill.io v3
https://github.com/pearofducks/koa-polyfill

koa middleware polyfill

Last synced: about 2 months ago
JSON representation

middleware to provide dynamic polyfills - based on polyfill.io v3

Awesome Lists containing this project

README

        

> koa-polyfill

Middleware that provides a self-hosted version of polyfill.io

#### use

```js
const _ = require('koa-route')
const { getPolyfill } = require('koa-polyfill')
const Koa = require('koa')
const app = new Koa()
app.use(_.get("/polyfill/v3/polyfill.(min.)?js", async (ctx) => {
await getPolyfill(ctx)
})
```

See index.js in this repo for a more complete example.