"visitor.js" isn't distinct in the field, particularly as it's descriptive and of a common form, I'd warrant it's not novel either.
That doesn't mean that you wouldn't be sued for using it just that any sane TM office shouldn't allow it to be registered and that a sane IP judge should dismiss a case brought against it's use as passing off. The law isn't sane of course ....
I think it's reasonable to use the same name if the scope is largely co-terminous.
The fork of OpenOffice.org was named LibreOffice, because it would be unfair to name a competing product with the same name. I'm glad the author of this library has decided to do the same.
OpenOffice.org is interesting because they previously named the project "Open Office" and suffered trademark problems and had to be very careful to use the full name of the project. But had the former project been called "Computer Office Suite" then trademark issues wouldn't have arisen because that's not a distinctive mark and so couldn't be protected, it's descriptive anyone selling such software could use that description.
It's not unfair to use an identical descriptive name for things that serve the same function - for example Microsoft and Apple both sell something that they use the term "Operating System" to describe. OS is a descriptve term that is expected to be used in the field and so can't be a trademark, it doesn't serve to indicate origin.
I'd argue that visitor.js is an expected name for a piece javascript that logs visitors in some way, it's not distinctive of origin. Moreover it is descriptive of the function of the code. Kinda like having an ad loader that's called ads.js.
FWIW, and I've not been paying too much attention (!), only one of the pieces of code labelled visitor.js appears to be a product.