I use Cheerio (https://github.com/MatthewMueller/cheerio) to clean up websites and get images for the project I'm working on. I am wondering if there is an easy way with Node.js (or another package) to convert $ (img) .attr ('src') to a full URL? Sometimes I get "image.jpg" and other times "../../image.jpg", and sometimes "//somepath/image.jpg". Maybe I'm just missing some sort of regex ... Thanks for your time :)
source share