Skip to Content
APIrealpath

realpath

Resolve the canonical absolute path for a path, resolving ., .., and symlinks.

Basic usage

import { realpath } from '@vooya/fs' const abs = await realpath('./some/relative/path') console.log(abs) // e.g. /home/user/proj/some/relative/path

Methods

realpath(path)

Async. Returns Promise<string> (canonical absolute path).

ArgumentTypeDescription
pathstringPath to resolve.

realpathSync(path)

Sync. Returns string or throws.

Performance

Single syscall (with resolution); on par with Node.js. See Benchmarks.

Notes

  • Symlinks: Fully resolves symlinks in the path. Fails if the target does not exist (same as Node.js).
  • Known gap: Missing-path errors currently have Node-like messages, but do not expose Node-style code, path, and syscall fields yet.
  • Unsupported Node inputs/options: Buffer paths, URL paths, the encoding option, realpath.native, and the legacy cache option are not part of the current Vooya FS realpath surface.

Competitor measurements

See the full realpath comparison table for Node 22/24, peer libraries, sync/Promise modes, small and batch workloads, execution routes and measurement limits.

Last updated on