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?

On Thursday, 8 January 2015 21:20:17 UTC, Gregg Caines wrote:
>
> Hey all... does anyone have a solution for detecting where/if a file is 
> required in a large codebase?  Manually grepping for it gets old pretty 
> quickly when there can be a difference in relative paths.  I can't find 
> anything like this in npm so I was thinking I could write such a thing 
> using https://github.com/substack/module-deps , but I thought I'd check 
> here first.
>
> Thanks!
>
> G     
>

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/dd1086cf-6284-41a8-93a7-3d194b5420c3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to