1
나는 프로그래밍에 대해 약간 새로운 지식을 가지고 있습니다. 내 문제는 내가 파일을 다운로드하고 그 후에 뭔가를하고 싶다는 것이다.파일을 다운로드 한 후 무언가를 수행
Danbooru.search(tag, function (err, data) { //search for a random image with the given tag
data.random() //selects a random image with the given tag
.getLarge() //get's a link to the image
.pipe(require('fs').createWriteStream('random.jpg')); //downloads the image
});
이제 파일을 다운로드 한 후 console.log를하고 싶습니다. 파일을 다운로드하는 데는 다른 시간이 걸리기 때문에 setTimeout을 사용하고 싶지 않습니다.
도움 주셔서 감사합니다.