A simple Node.js script for checking HTTP redirects across large lists of URLs. The script reads URLs from a text file, sends requests without following redirects, and exports the results to a CSV file.
- Put your URLs in the
urls.txtfile, one URL per line. - Run the script:
node script.js
- The script generates a results.csv file with three columns:
- url — the original URL
- status — the HTTP status code
- redirect_to — the value of the Location header (if present)
Node.js 18+ (uses the built-in fetch API)
- Processes large URL lists (1000+ entries)
- Detects redirects without following them
- Outputs clean CSV results
- Minimal dependencies
redirect-checker/
├── script.js
├── urls.txt
├── results.csv (generated)
├── package.json
├── .gitignore
└── README.mdFor testing purposes, you may use endpoints from httpbin.org:
https://httpbin.org/status/200
https://httpbin.org/redirect-to?url=https://example.com
https://httpbin.org/redirect/2
https://httpbin.org/status/404
https://httpbin.org/status/500