No handling is currently in place for any FS errors - either the file is successfully read or assumed to not exist.
Should any errors result in exceptions being thrown:
- Permission errors on FS
- Request for directory which does not exist
- Request for file which does not exist
- package.json exists but cannot be parsed
What should happen if /path/to/package.json denies read permissions but /path/to/file.js can be read? This edge case could result in the wrong decision, we should match whatever node.js would do. Should we assume commonjs upon access denied reading /path/to/package.json or should we attempt to look at /path/package.json?
No handling is currently in place for any FS errors - either the file is successfully read or assumed to not exist.
Should any errors result in exceptions being thrown:
What should happen if
/path/to/package.jsondenies read permissions but/path/to/file.jscan be read? This edge case could result in the wrong decision, we should match whatever node.js would do. Should we assumecommonjsupon access denied reading/path/to/package.jsonor should we attempt to look at/path/package.json?