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

superagent

Package Overview
Dependencies
Maintainers
1
Versions
174
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

superagent - npm Package Compare versions

Comparing version 0.9.5 to 0.9.6

build/build.css

7

component.json

@@ -7,3 +7,6 @@ {

"keywords": ["http", "ajax", "request", "agent"],
"main": "lib/superagent.js"
}
"scripts": ["index.js", "lib/superagent.js"],
"dependencies": {
"component/emitter": "0.0.6"
}
}
0.9.6 / 2012-10-17
==================
* change: use `this` when `window` is undefined
* update to new component spec [juliangruber]
* fix emission of "data" events for compressed responses without encoding. Closes #125
0.9.5 / 2012-10-01

@@ -3,0 +10,0 @@ ==================

@@ -1,4 +0,7 @@

module.exports = process.env.SUPERAGENT_COV
? require('./lib-cov/node')
: require('./lib/node');
if (typeof window != 'undefined') {
module.exports = require('./lib/superagent');
} else if (process.env.SUPERAGENT_COV) {
module.exports = require('./lib-cov/node');
} else {
module.exports = require('./lib/node');
}

@@ -95,7 +95,7 @@

var unzip = zlib.createUnzip()
, decodedStream = new Stream
, stream = new Stream
, decoder;
// make node responseOnEnd() happy
decodedStream.req = req;
stream.req = req;

@@ -112,8 +112,12 @@ // pipe to unzip

unzip.on('data', function(buf){
var str = decoder.write(buf);
if (str.length) decodedStream.emit('data', str);
if (decoder) {
var str = decoder.write(buf);
if (str.length) stream.emit('data', str);
} else {
stream.emit('data', buf);
}
});
unzip.on('end', function(){
decodedStream.emit('end');
stream.emit('end');
});

@@ -125,3 +129,3 @@

if ('data' == type || 'end' == type) {
decodedStream.on(type, fn);
stream.on(type, fn);
} else {

@@ -128,0 +132,0 @@ _on.call(res, type, fn);

@@ -1,2 +0,1 @@

/*!

@@ -8,2 +7,4 @@ * superagent

var root = typeof window == 'undefined' ? this : window;
;(function(){

@@ -26,4 +27,4 @@

function getXHR() {
if (window.XMLHttpRequest
&& ('file:' != window.location.protocol || !window.ActiveXObject)) {
if (root.XMLHttpRequest
&& ('file:' != root.location.protocol || !root.ActiveXObject)) {
return new XMLHttpRequest;

@@ -754,3 +755,3 @@ } else {

if ('undefined' == typeof exports) {
window.request = window.superagent = request;
root.request = root.superagent = request;
} else {

@@ -757,0 +758,0 @@ module.exports = request;

{
"name": "superagent",
"version": "0.9.5",
"version": "0.9.6",
"description": "elegant & feature rich browser / node HTTP with a fluent API",

@@ -5,0 +5,0 @@ "keywords": [

@@ -5,6 +5,12 @@

request
.post('http://127.0.0.1:3000/')
.send('foo=bar')
.end(function(res){
console.log(res.text);
})
.get('http://othstatic.propertycdn.com/clean/js/load.v5.6.4.js')
.set('Accept-Encoding', 'gzip')
.end(function(res){
console.log(res.header['content-encoding']);
res.on('data', function(chunk){
console.log(chunk.toString());
}).on('end', function(){
console.log('end');
});
})
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