Skip to Content
APIreadlink

readlink

Read the target path of a symbolic link. Fails for non-symlinks.

Basic usage

import { readlink } from '@vooya/fs' const target = await readlink('./mylink') console.log(target) // raw stored target path

Methods

readlink(path)

Async. Returns Promise<string> (the link target path).

ArgumentTypeDescription
pathstringSymlink path.

readlinkSync(path)

Sync. Returns string or throws (e.g. EINVAL if not a symlink).

Performance

Single syscall; on par with Node.js. See Benchmarks.

Notes

  • Resolution: Returns the raw target string; use realpath to resolve to an absolute path and follow nested symlinks.
  • Known gap: Missing-path and non-symlink 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, and the encoding option are not part of the current Vooya FS readlink surface.

Competitor measurements

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

Last updated on