Socket
Socket
Sign inDemoInstall

urllib

Package Overview
Dependencies
Maintainers
1
Versions
221
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

urllib - npm Package Compare versions

Comparing version 0.3.2 to 0.3.3

5

History.md
0.3.3 / 2012-12-14
==================
* support writeStream
0.3.2 / 2012-11-08

@@ -3,0 +8,0 @@ ==================

19

lib/urllib.js

@@ -46,2 +46,4 @@ /**

* - {ReadStream} [stream]: read stream to sent.
* - {WriteStream} [writeStream]: writable stream to save response data.
* If you use this, callback's data should be null.
* - {String} [type]: optional, could be GET | POST | DELETE | PUT, default is GET

@@ -129,3 +131,9 @@ * - {String} [dataType]: optional, `text` or `json`, default is text

var writeStream = args.writeStream;
var req = httplib.request(options, function (res) {
if (writeStream) {
res.on('end', callback.bind(null, null, null, res));
return res.pipe(writeStream);
}
var chunks = [], size = 0;

@@ -158,3 +166,3 @@ res.on('data', function (chunk) {

}, timeout);
req.on('error', function (err) {
req.once('error', function (err) {
if (!__err && err.name === 'Error') {

@@ -166,5 +174,12 @@ err.name = 'RequestError';

if (writeStream) {
writeStream.once('error', function (err) {
__err = err;
req.abort();
});
}
if (args.stream) {
args.stream.pipe(req);
args.stream.on('error', function (err) {
args.stream.once('error', function (err) {
__err = err;

@@ -171,0 +186,0 @@ req.abort();

2

package.json
{
"name": "urllib",
"version": "0.3.2",
"version": "0.3.3",
"description": "Help in opening URLs (mostly HTTP) in a complex world — basic and digest authentication, redirections, cookies and more.",

@@ -5,0 +5,0 @@ "keywords": [ "urllib", "http", "urlopen", "curl", "wget" ],

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