How about:

```javascript
isShorter = exports.pathDept(internalFileName) < exports.pathDept(jsonfile);
jsonfile = (jsonfile ? (isShorter ? internalFileName : jsonfile) : internalFileName);
package_path = path.normalize(jsonfile.split('package.json')[0] || './' );
```

I don't know ... I just don't function definitions within functions :)