Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cross-fetch-ponyfill

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cross-fetch-ponyfill - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

12

browser.js

@@ -1,1 +0,11 @@

export default self.fetch
export const Blob = self.Blob
export const File = self.File
export const FormData = self.FormData
export const Headers = self.Headers
export const Request = self.Request
export const Response = self.Response
export const AbortController = self.AbortController
export const AbortSignal = self.AbortSignal
export const fetch = self.fetch || (() => { throw new Error('global fetch is not available!') })
export default fetch

@@ -1,3 +0,30 @@

import polyfill from 'node-fetch'
import _fetch, {
Blob as _Blob,
File as _File,
FormData as _FormData,
Headers as _Headers,
Request as _Request,
Response as _Response
} from 'node-fetch'
export default global.fetch || polyfill
export const fetch = global.fetch || _fetch
export default fetch
export const Blob = global.Blob || _Blob
export const File = global.File || _File
export const FormData = global.FormData || _FormData
export const Headers = global.Headers || _Headers
export const Request = global.Request || _Request
export const Response = global.Response || _Response
export const AbortController = global.AbortController
export const AbortSignal = global.AbortSignal
export {
AbortError,
FetchError,
blobFrom,
blobFromSync,
fileFrom,
fileFromSync,
isRedirect
} from 'node-fetch'

13

package.json
{
"name": "cross-fetch-ponyfill",
"version": "1.0.0",
"version": "1.0.1",
"type": "module",
"description": "Fetch polyfilled in Node only",
"main": "node.js",
"browser": "browser.js",
"exports": {
"node": "./node.js",
"default": "./browser.js"
},
"browser": {
"node-fetch": false,
"abort-controller": false
},
"repository": {

@@ -25,2 +31,3 @@ "type": "git",

"dependencies": {
"abort-controller": "^3.0.0",
"node-fetch": "^3.3.0"

@@ -27,0 +34,0 @@ },

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc