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>.
| Argument | Type | Description |
|---|---|---|
path | string | File, 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
| Scale | Fixture | Node.js | Vooya FS | Ratio | Node RSS | Vooya FS RSS |
|---|---|---|---|---|---|---|
| single-file | - | 0.05 ms | 0.13 ms | 2.62x slower | 30.4 KB | 6.4 KB |
| directory | - | 0.14 ms | 0.06 ms | 2.56x faster | 0 B | 3.2 KB |
| symlink | - | 0.04 ms | 0.03 ms | 1.57x faster | 0 B | 0 B |
| batch-128-files | - | 1.48 ms | 1.34 ms | 1.10x faster | 8.0 KB | 0 B |
Notes
- Symlinks: Use
lstatto detect and inspect symlinks; usestatto get the resolved file’s stats. - Known gap: Missing-path errors currently have Node-like messages, but do not expose Node-style
code,path, andsyscallfields yet. - Unsupported Node options:
bigint,throwIfNoEntry,Bufferpaths, andURLpaths are not part of the current Vooya FSlstatsurface.
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