Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
doc: add cache argument to fs.realpath()
Browse files Browse the repository at this point in the history
  • Loading branch information
shama authored and bnoordhuis committed Apr 17, 2012
1 parent 5bc07cc commit 7cd1690
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions doc/api/fs.markdown
Expand Up @@ -194,12 +194,22 @@ linkString)`.

Synchronous readlink(2). Returns the symbolic link's string value.

## fs.realpath(path, [callback])
## fs.realpath(path, [cache], callback)

Asynchronous realpath(2). The callback gets two arguments `(err,
resolvedPath)`. May use `process.cwd` to resolve relative paths.
Asynchronous realpath(2). The `callback` gets two arguments `(err,
resolvedPath)`. May use `process.cwd` to resolve relative paths. `cache` is an
object literal of mapped paths that can be used to force a specific path
resolution or avoid additional `fs.stat` calls for known real paths.

## fs.realpathSync(path)
Example:

var cache = {'/etc':'/private/etc'};
fs.realpath('/etc/passwd', cache, function (err, resolvedPath) {
if (err) throw err;
console.log(resolvedPath);
});

## fs.realpathSync(path, [cache])

Synchronous realpath(2). Returns the resolved path.

Expand Down

0 comments on commit 7cd1690

Please sign in to comment.