I have a situation (real-world, this exists in the http-proxy module), where the following two things are in the same directory:
http-proxy.js - a file
http-proxy - a folder containing an 'index.js' file
http-proxy.js contains require('./http-proxy/'), which node.js resolves to ./http-proxy/index.js. node-resolve on the other hand, incorrectly resolves it to ./http-proxy.js.