New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

nodejs-polyfill

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nodejs-polyfill

dom polyfill for nodejs

latest
npmnpm
Version
1.4.1
Version published
Weekly downloads
7
Maintainers
1
Weekly downloads
 
Created
Source

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 - default setTimeout node function
  • window.clearTimeout - default clearTimeout node function
  • window.WebSocket - version from global object
  • window.ArrayBuffer - version from global object only
  • window.addEventListener - empty void function
  • window.navigator - { onLine: true }
  • window.isNodeJS - to check if polyfills were aplied
  • window.localStorage - in memory storage
  • window.sessionStorage - in memory storage
  • window.Date - version from global object
  • global.XMLHttpRequest - using xhr2
  • global.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

Keywords

polyfill

FAQs

Package last updated on 02 Jun 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts