You could use something like a code coverage tool like Istanbul but this won't work unless you are testing thoroughly. Also, just because you have a test for something doesn't mean it is still 'required'.
In the past I've used 404 handlers to try and get a handle on a legacy front end code base by doing the following:
1. copy all files to a new location (./old)
2. delete all existing files (./clean is now empty)
3. a request comes in for file ./clean/x.js
4. if not found (404) then copy the file from ./old/x.js to ./clean/x.js and return the contents of the file.
5. subsequent requests will just return the file as it will be found so no 404 error.
We ran this in production for 3 months and only missed 2 or 3 very rarely used files. A hit rate of 99.9+%.
Perhaps this technique could work here too?