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

fetch-ponyfill

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fetch-ponyfill - npm Package Compare versions

Comparing version 0.3.2 to 0.4.0

fetch.js

6

index.js

@@ -5,5 +5,5 @@ 'use strict';

'"use strict"',
'var window = {};',
require('fs').readFileSync(__dirname + '/node_modules/fetch/fetch.js', 'utf8'),
'return window.fetch;'
'var self = {};',
require('fs').readFileSync(__dirname + '/fetch.js', 'utf8'),
'return self.fetch;'
].join('\n');

@@ -10,0 +10,0 @@

{
"name": "fetch-ponyfill",
"version": "0.3.2",
"version": "0.4.0",
"description": "A ponyfill (doesn't overwrite the native fetch) for the Fetch specification https://fetch.spec.whatwg.org.",

@@ -16,4 +16,9 @@ "main": "index.js",

"dependencies": {
"fetch": "git://github.com/github/fetch#v0.3.2"
"brfs": "1.2.0"
},
"browserify": {
"transform": [
"brfs"
]
}
}

@@ -27,16 +27,1 @@ # Fetch Ponyfill

| `XMLHttpRequest` | The XMLHttpRequest constructor. This is useful to feed in when working with Firefox OS. Defaults to `window.XMLHttpRequest`. |
## Warning
This module currently wraps [github/fetch](https://github.com/github/fetch) by tricking it into
leaving the window object alone by loading the source as a string and wrapping it in a
`new Function`. This means that:
- `brfs` must be used.
- `npm dedupe` should be avoided, since browserify and thus brfs do not have access to
`require.resolve` and `dedupe` may move fetch. See
[here](https://github.com/substack/brfs/issues/13).
I don't currently have time to support and keep a fork of fetch up to date with the spec as it
evolves. By wrapping fetch, I avoid that effort. However, the above restrictions may mean that in
the future I switch to a proper fork.
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