mirror of
				https://github.com/therootcompany/request.js.git
				synced 2024-11-16 17:28:58 +00:00 
			
		
		
		
	Compare commits
	
		
			3 Commits
		
	
	
		
			ed2bab931f
			...
			2e9a643c0f
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 2e9a643c0f | |||
| dcd41a33d0 | |||
| 5f5e0b6066 | 
							
								
								
									
										22
									
								
								.jshintrc
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								.jshintrc
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,22 @@ | ||||
| { | ||||
|   "browser": true, | ||||
|   "node": true, | ||||
|   "esversion": 11, | ||||
|   "curly": true, | ||||
|   "sub": true, | ||||
|   "bitwise": true, | ||||
|   "eqeqeq": true, | ||||
|   "forin": true, | ||||
|   "freeze": true, | ||||
|   "immed": true, | ||||
|   "latedef": "nofunc", | ||||
|   "nonbsp": true, | ||||
|   "nonew": true, | ||||
|   "plusplus": true, | ||||
|   "undef": true, | ||||
|   "unused": "vars", | ||||
|   "strict": true, | ||||
|   "maxdepth": 3, | ||||
|   "maxstatements": 100, | ||||
|   "maxcomplexity": 40 | ||||
| } | ||||
							
								
								
									
										26
									
								
								index.js
									
									
									
									
									
								
							
							
						
						
									
										26
									
								
								index.js
									
									
									
									
									
								
							| @ -76,6 +76,19 @@ function setDefaults(defs) { | ||||
|         var req; | ||||
|         var finalOpts = {}; | ||||
| 
 | ||||
|         // allow specifying a file
 | ||||
|         if ('string' === typeof opts.stream) { | ||||
|             if (opts.debug) { | ||||
|                 console.debug('[@root/request] creating file write stream'); | ||||
|             } | ||||
|             try { | ||||
|                 opts.stream = fs.createWriteStream(opts.stream); | ||||
|             } catch (e) { | ||||
|                 cb(e); | ||||
|                 return; | ||||
|             } | ||||
|         } | ||||
| 
 | ||||
|         function onResponse(resp) { | ||||
|             var followRedirect; | ||||
| 
 | ||||
| @ -151,19 +164,6 @@ function setDefaults(defs) { | ||||
|                     reject = _reject; | ||||
|                 }); | ||||
| 
 | ||||
|                 // allow specifying a file
 | ||||
|                 if ('string' === typeof opts.stream) { | ||||
|                     try { | ||||
|                         if (opts.debug) { | ||||
|                             console.debug( | ||||
|                                 '[@root/request] file write stream created' | ||||
|                             ); | ||||
|                         } | ||||
|                         opts.stream = fs.createWriteStream(opts.stream); | ||||
|                     } catch (e) { | ||||
|                         cb(e); | ||||
|                     } | ||||
|                 } | ||||
|                 // or an existing write stream
 | ||||
|                 if ('function' === typeof opts.stream.pipe) { | ||||
|                     if (opts.debug) { | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user