@azteam/http-client
Advanced tools
Comparing version 1.0.40 to 1.0.41
{ | ||
"name": "@azteam/http-client", | ||
"version": "1.0.40", | ||
"version": "1.0.41", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
import fs from 'fs'; | ||
import qs from 'querystring'; | ||
import {parse} from 'node-html-parser'; | ||
import { parse } from 'node-html-parser'; | ||
import axios from 'axios'; | ||
@@ -18,3 +18,3 @@ import http from 'http'; | ||
resolveJSON: false, | ||
httpAgent: new http.Agent({keepAlive: true}), | ||
httpAgent: new http.Agent({ keepAlive: true }), | ||
...options, | ||
@@ -26,3 +26,3 @@ }; | ||
_resetOptions() { | ||
this.options = {...this.init_opts}; | ||
this.options = { ...this.init_opts }; | ||
this.options.headers = { | ||
@@ -91,3 +91,2 @@ ...this.init_opts.headers | ||
const file = fs.createWriteStream(fileDir); | ||
this.options.url = encodeURI(url); | ||
@@ -99,5 +98,4 @@ | ||
responseType: 'stream', | ||
}).then(function (response) { | ||
response.data.pipe(fs.createWriteStream(fileDir)); | ||
}).then((response) => { | ||
response.data.pipe(file); | ||
response.data.on('finish', () => { | ||
@@ -155,2 +153,2 @@ const stats = fs.statSync(fileDir); | ||
export default HttpClient; | ||
export default HttpClient; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17775
341