Skip to Content
APIlstat

lstat

Get file/directory metadata without following symlinks. For the link target, use stat.

Basic usage

import { lstat } from '@vooya/fs' const s = await lstat('./some-link') console.log(s.isSymbolicLink(), s.size)

Methods

lstat(path)

Async. Returns Promise<Stats>.

ArgumentTypeDescription
pathstringFile, directory, or symlink path.

Return type Stats is the same as stat; when path is a symlink, the returned stats describe the link, not the target.

lstatSync(path)

Sync. Same arguments; returns Stats or throws.

Performance

Single syscall; same order as stat. On par with Node.js (~1.2x in micro-benchmarks). See Benchmarks.

Local scale report

Generated from local performance reports. Do not edit this block by hand.

  • Runtime: v22.22.0 on darwin/arm64
  • Samples: 2 warmup runs, 10 measured runs
  • Aggregation: trimmed mean for wall-clock time; average per-run memory delta for RSS
ScaleFixtureNode.jsVooya FSRatioNode RSSVooya FS RSS
single-file-0.05 ms0.13 ms2.62x slower30.4 KB6.4 KB
directory-0.14 ms0.06 ms2.56x faster0 B3.2 KB
symlink-0.04 ms0.03 ms1.57x faster0 B0 B
batch-128-files-1.48 ms1.34 ms1.10x faster8.0 KB0 B

Notes

  • Symlinks: Use lstat to detect and inspect symlinks; use stat to get the resolved file’s stats.
  • Known gap: Missing-path errors currently have Node-like messages, but do not expose Node-style code, path, and syscall fields yet.
  • Unsupported Node options: bigint, throwIfNoEntry, Buffer paths, and URL paths are not part of the current Vooya FS lstat surface.

Competitor measurements

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

Last updated on