DEV Community

Anthony Slater
Anthony Slater

Posted on

Reviewing URLChecker

Since I recently started development of a command line tool that searches a source file for URLs and check their status, I decided to review an existing one while I'm at it. My tool is written in Python, but I'm interested to see how the same task could be done using JavaScript.

GitHub logo danishalim / URLChecker

Bulk check URL status codes

First thing I noticed was just how fast async functions are! I ran this tool against the same source file I've been using to develop my own work and it took maybe 15 seconds. Maybe. Usually when I run my Python URL checking tool, I get up to walk around and check back in a few minutes...

My one criticism of URLChecker is the regular expression it uses to find URLs in a file. I ran into the same issue myself during development and fixing it ended up opening up a whole other can of worms. Once the regex includes characters like [] and () then:

"http://some(web).site" // matches http://some(web).site
"(http://someweb.site)" // matches http://someweb.site)

Although URLChecker will need to update its regex so it includes all valid URL characters, I am extremely envious of how fast it produces its results.

Top comments (0)