This npm script crawls through a JSON sitemap of URLs (config/sitemap.json
), retrieves all images from the HTML image elements and requests each URL to get its file size and content type. It generates a CSV with image urls, file size, file type and reference pages.
npm install
- Adjust
config/config.js
with your configuration preferences:
logging // this will enable/disable logging<br>
timeout // the time between network requests (in milliseconds)
-
Add your URLs to sitemap.json. Each item in the JSON array should be a url string
-
Run the program with:
npm run start
The results will be saved in results/<unique-filename>.csv
. The program will output the unique file name when the execution finishes.
This software was tested on Node.js v18.17.1
and NPM v10.0.0