web-core
v0.0.4
Published
WebAPI Standard Library
Downloads
7
Readme
web-core
Modular standard library for JavaScript WebAPIs. Includes polyfills for Fetch API, Document.elementsFromPoint(), Window.getComputedStyle(), Element.matches(), XPath and more. You can require only needed features or use it without global namespace pollution.
Example:
fetch('https://github.com'); // => Response
Without global namespace pollution:
import web from 'web-js/library';
web.fetch('https://github.com') // => Response
Usage
Basic
$ npm i -s web-js
// Default
import 'web-js';
// Without global namespace pollution
import web from 'web-js/library';
Partial
import 'web-js/fetch';
// or
import fetch from 'web-js/library/fetch';
Credit
- Sergey Starodub
- Element.matches()
- Window.getComputedStyle()
- Iddan Aharonson
- Document.elementsFromPoint()
- Evan Krambuhl
- CustomEvent
- GitHub
- Google
- XPath (Based on work by Cybozu Labs)