Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
download-use-throw
Advanced tools
Readme
Download something - use it - finally delete it
This package helps you to temporarily download an image and apply your method on it. When you are finished using the downloaded content, the image will automatically get deleted.
This package is using Nodejs streams, means, more efficient.
npm i --save download-use-throw
const useAndThrow = require('download-use-throw');
const path = require('path');
// path to the directory to which
// images are temporarily downloaded
const dirPath = path.join(__dirname, '/temp');
// url of the image to be downloaded
const imgUrl = "https://i.ytimg.com/vi/YQHsXMglC9A/maxresdefault.jpg";
// use and throw
useAndThrow(imgUrl, dirPath, imageHandler);
// function to apply on the downloaded image
function imageHandler(err, pathToImage, done) {
if(err){
// handle err
return done(); // call to done will trigger the deletion process.
}
// use the image
useTheImage(pathToImage); // your function
// ...
// ...
// ...
// when you finished using the image, call done()
// which will trigger the deletion process
done();
}
Call done()
when you finished using the image, or you finished handling errors. It will initiate the deletion process.
Unclear about something? Please rise an issue.
Please report any issues at github.
MIT © Vajahath Ahmed
FAQs
Download something - use it - finally delete it
The npm package download-use-throw receives a total of 3 weekly downloads. As such, download-use-throw popularity was classified as not popular.
We found that download-use-throw demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.