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

minixhr

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

minixhr - npm Package Compare versions

Comparing version 1.2.2 to 1.3.3

6

index.js

@@ -18,3 +18,3 @@ var XMLHttpRequest = require('xhrpolyfill');

var xhr = XMLHttpRequest();
if (!xhr) { return null };
if (!xhr) { throw new Error('No AJAX support'); };
xhr.open(args.method,args.url);

@@ -30,5 +30,7 @@ for (var field in args.headers) {

});
callback(this.response, response, xhr, headerJSON);
if (callback) {
callback(this.response, response, xhr, headerJSON);
}
};
xhr.send(args.body||null);
};
{
"name": "minixhr",
"version": "1.2.2",
"version": "1.3.3",
"description": "super simpel and small cross-browser xhr",

@@ -26,4 +26,4 @@ "main": "index.js",

"dependencies": {
"xhrpolyfill": "^1.0.0"
"xhrpolyfill": "^1.3.0"
}
}

@@ -8,7 +8,17 @@ # minixhr

var request = { url: 'http://github.com/serapath/holonify' };
var callback = function responseHandler (data, response, xhr, header) { console.log(data); };
var request = { // can be 'url string' or object:
url : 'http://github.com/serapath/holonify', // or e.g. http://ip.jsontest.com/a=1&b=2&c=3
method : 'POST', // [optional] (defaults to 'GET')
body : 'payload', // [optional] payload data could be <formdata> or {key:val}'s or anything
header : {} // [optional] (defaults to '{}' or in case of 'POST':
// {'X-Requested-With':'XMLHttpRequest','Content-Type':'application/x-www-form-urlencoded' } )
};
minixhr(request, function responseHandler (data, response, xhr, header) {
console.log(data);
});
// EXAMPLE 1
minixhr(request); // [optional] callback - (e.g. leave out for POST Request where you don't care about a response
// EXAMPLE 2
minixhr('http://requestb.in/qpvy9dqp', function (data) { console.log(data); });
```
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