• Stars
    star
    175
  • Rank 218,059 (Top 5 %)
  • Language
    JavaScript
  • Created over 8 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

MDN polyfills - from, forEach, filter, find, findIndex, assign, includes, create, entries, of, repeat, startsWith, endsWith, toggleAttribute, bind, MouseEvent, CustomEvent, padEnd, padStart

Polyfills copy-pasted from MDN Build Status npm dependencies

MDN polyfills. A collection of side-effect ECMAScript modules. Minimized, mangled and extremely small thanks to Rollup - next-generation ES6 module bundler.

Installation

npm i mdn-polyfills --save

Usage

import 'mdn-polyfills/POLYFILL_NAME';

// For example:

// (ES6 Modules)
import 'mdn-polyfills/Array.prototype.includes';
import 'mdn-polyfills/Object.create';

// (CommonJS)
require('mdn-polyfills/CustomEvent');
require('mdn-polyfills/String.prototype.padStart');

// and so on ...

Polyfills are also available over a CDN, for example

<script src="https://unpkg.com/mdn-polyfills/Object.assign"></script>
<script src="https://cdn.jsdelivr.net/npm/mdn-polyfills/NodeList.prototype.forEach.js"></script>

Supported polyfills

name size [b]
Object.assign 274
Object.create 299
Object.entries 151
Object.keys 723
Object.values 142
Array.from 788
Array.of 79
Array.prototype.fill 343
Array.prototype.filter 300
Array.prototype.find 330
Array.prototype.findIndex 362
Array.prototype.forEach 328
Array.prototype.includes 346
Array.prototype.some 346
Array.prototype.reduce 492
String.prototype.includes 153
String.prototype.repeat 504
String.prototype.startsWith 117
String.prototype.endsWith 148
String.prototype.padStart 209
String.prototype.padEnd 205
String.prototype.trim 121
Function.prototype.bind 427
Node.prototype.addEventListener 1321
Node.prototype.append 433
Node.prototype.prepend 452
Node.prototype.before 440
Node.prototype.after 461
Node.prototype.remove 290
Node.prototype.replaceWith 731
Node.prototype.children 245
Node.prototype.firstElementChild 262
NodeList.prototype.forEach 158
Element.prototype.closest 333
Element.prototype.toggleAttribute 243
Element.prototype.matches 133
Element.prototype.classList 4450
Element.prototype.getAttributeNames 182
MouseEvent 405
CustomEvent 279
Number.isInteger 106
Number.isNaN 53
HTMLCanvasElement.prototype.toBlob 276

License

The mdn-polyfills as a module is licensed under MIT © Michał Jezierski
Polyfills are licensed under https://developer.mozilla.org/en-US/docs/MDN/About#Copyrights_and_licenses

More Repositories

1

wilson-score-interval

Wilson score interval implemented in javascript
JavaScript
32
star
2

vrt-react

Take a screenshot 📸 of React component. Push it and compare images in pull request.
JavaScript
20
star
3

fake-fetch

fake window.fetch for tests
JavaScript
18
star
4

ale-url-parser

🍺 Top fermented URL parser and stringifier built with performance and small size in mind.
JavaScript
15
star
5

teti

CLI for testing DOM timings built upon Headless Chrome & Lighthouse 💜
JavaScript
14
star
6

stats-percentile

📈 Calculate n-th percentile
JavaScript
13
star
7

sweter

Frontend performance reporter with scheduling and ElasticSearch support
JavaScript
11
star
8

file-downloader

A fetch-based file downloader
JavaScript
9
star
9

czysty.js

The fastest and smallest 🚀framework ever. For the web.
JavaScript
7
star
10

json-es6-loader

Transform JSON into ES6 Module. The way to enable Tree Shaking for imported JSONs.
JavaScript
5
star
11

kitty

lightweight mvc for js
JavaScript
5
star
12

a6-examples

Angular6 - unit and visual regression tests
TypeScript
5
star
13

subsup

Unicode subscripts and superscripts mapper
JavaScript
4
star
14

stats-mad

Calculate Median Absolute Deviation (MAD)
JavaScript
4
star
15

async-components

Async Components for the Web
JavaScript
4
star
16

object-assign-mdn

Object.assign polyfill
JavaScript
3
star
17

dead-simple-curry

🍺 Probably the simplest currying ever :)
JavaScript
3
star
18

runtime-caching

💡 simple runtime caching solution
JavaScript
3
star
19

sonar-psi

PageSpeed Insights plugin for SonarQube
Java
3
star
20

grunt-variablize

Provide json file as js variable
JavaScript
3
star
21

remote-json-loader

Webpack loader for remote resources
JavaScript
3
star
22

vss-sdk-module

Modularized VSS SDK
JavaScript
2
star
23

alt-dom-events

bind DOM events to alt actions
JavaScript
2
star
24

duplicates

Find duplicate files
JavaScript
2
star
25

brew

JavaScript
2
star
26

ts-react-example

React Components written in TypeScript
JavaScript
1
star
27

eslint-config-helmut

eslint config
JavaScript
1
star
28

gettext-plurals

gettext plural forms
JavaScript
1
star
29

wilson-node

Wilson score interval - a node module
JavaScript
1
star
30

ed-functors

Equationally definable functors - master thesis
TeX
1
star
31

sweter-stats-reporter

Stats reporter for sweter
JavaScript
1
star
32

stats-median

Calculate median of a given data
JavaScript
1
star
33

webpack-vs-rollup

Rollup vs Webpack
JavaScript
1
star
34

michal.jezierski

about me
JavaScript
1
star
35

webworkers-ajax

XHR requests with WebWorkers support
JavaScript
1
star
36

TaaS

Toilet as a Service
HTML
1
star