This way, require("/foo") will work if there is a "foo.js", or a file named simply "foo" with no extension.