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 pathMethods
readlink(path)
Async. Returns Promise<string> (the link target path).
| Argument | Type | Description |
|---|---|---|
path | string | Symlink 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
realpathto 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, andsyscallfields yet. - Unsupported Node inputs/options:
Bufferpaths,URLpaths, and theencodingoption are not part of the current Vooya FSreadlinksurface.
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