Given a possibly case-variant version of an existing filesystem path, returns the absolute, case-exact, normalized version as stored in the filesystem.
NOTE: If no matching path exists, an error with be thrown.
Optionally takes a second argument to use as the base path to begin case-correction from. This can be particularly useful within shared hosting environments since true-case-path relies on the ability to list a directory's contents in order to check the case and attempting to list the contents of
/home will generally result in a permissions error.
NOTE: When specifying a basePath, the first argument is expected to be the file path relative to that basePath. If the first argument is absolute, every path segment will be checked. basePath defaults to
process.cwd()if not specified and the first argument is relative.
Windows, OSX, and Linux
trueCasePathSync'/users/guest' // OSX: -> '/Users/Guest'trueCasePathSync'c:\\users\\all users' // Windows: -> 'c:\Users\All Users'