Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
nuxodin authored Apr 15, 2021
1 parent 8bbb13a commit d334646
Showing 1 changed file with 23 additions and 4 deletions.
27 changes: 23 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,40 @@
# lazyfill
# lazyfill (beta)

Polyfill Service - the lazy way

Polyfills are only loaded when they are needed.
Initial 2Kb to polyfill a lot of Stuff.

Let's assume that your browser does not support the function "Element.prototype.toggleAttribute".
```js
> ['a','b','c'].at(-1); // accessing [].at immediatel loads the polyfill
> 'c'
```


# Ussage

Add this script on the top of your page:

```html
<script src="https://cdn.jsdelivr.net/gh/nuxodin/lazyfill@xxxxx/mod.min.js"></script>
```
done!

# How it works

To every polyfillable property, the scripts adds a getter which synchronously loads the corresponding polyfill.
Of course, we all know that blocking xhr-requests is not nice.
Therefore, the url to the script that should be added to the page is given in the console.

# Help
Any help is greatly appreciated.

## Resources
# Thanks / Resources

https://github.com/behnammodi/polyfill

https://polyfill.io/v3/

https://ungap.github.io/

https://github.com/Sylvain59650/all-polyfills
https://github.com/Sylvain59650/all-polyfills

0 comments on commit d334646

Please sign in to comment.