videoIds.forEach((videoId) => YTDL.download(videoId, (err, filePath) => // ... ); );
const YouTubeMP3Downloader = require("youtube-mp3-downloader"); youtube-mp3-downloader npm
The constructor for YoutubeMp3Downloader accepts a settings object that allows you to customize the behavior: videoIds