1.4.1 • Published 11 months ago
nodejs-polyfill v1.4.1
Polyfill on Node.js
Polyfil your node.js environment with this as the window
when launching your own code
node -r nodejs-polyfill app.js
What is polyfilled?
- usage of
window
in the code or libraries window.setTimeout
- defaultsetTimeout
node functionwindow.clearTimeout
- defaultclearTimeout
node functionwindow.WebSocket
- version from global objectwindow.ArrayBuffer
- version from global object onlywindow.addEventListener
- empty void functionwindow.navigator
-{ onLine: true }
window.isNodeJS
- to check if polyfills were apliedwindow.localStorage
- in memory storagewindow.sessionStorage
- in memory storagewindow.Date
- version from global objectglobal.XMLHttpRequest
- using xhr2global.WebSocket
- using ws if the right flag is not set- if the above functions/properties are already set in the
global
object then they will be taken into the account