node-curl-impersonate
Advanced tools
Comparing version 1.1.1 to 1.1.2
{ | ||
"name": "node-curl-impersonate", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "A wrapper around cURL-impersonate, a binary which can be used to bypass TLS fingerprinting.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -108,28 +108,8 @@ /* | ||
getRequest(flags: Array<string>, headers: string) { | ||
return new Promise((resolve, reject) => { | ||
// GET REQUEST | ||
const binpath = path.join(__dirname, '..', 'bin', this.binary); | ||
const args = `${flags.join(' ')} ${headers} ${this.url}`; | ||
const childProcess = proc.spawn(`${binpath} ${args}`, { shell: true }); | ||
let stdoutData = ''; | ||
childProcess.stdout.on('data', (data) => { | ||
stdoutData += data.toString(); | ||
}); | ||
childProcess.on('error', (error) => { | ||
reject(error); | ||
}); | ||
childProcess.on('close', (code) => { | ||
if (code === 0) { | ||
resolve(stdoutData); | ||
} else { | ||
reject(new Error(`Child process exited with code ${code}`)); | ||
} | ||
}); | ||
}); | ||
} | ||
// GET REQUEST | ||
let binpath = path.join(__dirname, '..', 'bin', this.binary); | ||
let args = `${flags.join(' ')} ${headers} ${this.url}`; | ||
const result = proc.spawnSync(`${binpath} ${args}`, { shell: true }); | ||
return result.stdout.toString(); // Convert the stdout buffer to a string and return it | ||
} | ||
@@ -136,0 +116,0 @@ postRequest(flags: Array<string>, headers: string) { |
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
8834612
250