@purplet/polyfill
v1.2.1
Published
Polyfills for node.js and bun.js
Downloads
9
Readme
@purplet/polyfill
Modifies global scope to apply polyfills for Node.js and Bun for Web Standards that they do not currently support.
fetch
(node <=17)- provided by
undici
- includes
Request
,Response
,FormData
,Headers
,File
globals in addition tofetch
- provided by
FormData
(node <=17, bun as of v2.1)- provided by
formdata-node
, only applied in cases wherefetch
exists butFormData
is not. fetch
andBlob
are patched to support passingFormData
as a body, with code provided byform-data-encoder
. (This might break some other uses ofBlob
).
- provided by
WebSocket
(node as of v19)- provided by
ws
- provided by
structuredClone
(node <=17, bun as of v2.1, some browsers)- provided by
@ungap/structured-clone
- provided by
- parsing of
.env
files (node)- provided by
dotenv
- provided by
Blob
(node <=17)- provided by
node:buffer
on Node.js
- provided by
crypto
(node <=17)- provided by
node:crypto
on Node.js
- provided by