Skip to content

A lightweight Node.js tool for checking HTTP redirects for large lists of URLs and exporting results to CSV.

Notifications You must be signed in to change notification settings

Lacertilia1/redirect-checker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Redirect Checker

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.

Example of results.csv

How It Works

  1. Put your URLs in the urls.txt file, one URL per line.
  2. Run the script:
    node script.js
  3. 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)

Requirements

Node.js 18+ (uses the built-in fetch API)

Features

  • Processes large URL lists (1000+ entries)
  • Detects redirects without following them
  • Outputs clean CSV results
  • Minimal dependencies

File Structure

redirect-checker/
  ├── script.js
  ├── urls.txt
  ├── results.csv (generated)
  ├── package.json
  ├── .gitignore
  └── README.md

Test URLs

For 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

About

A lightweight Node.js tool for checking HTTP redirects for large lists of URLs and exporting results to CSV.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published