link
Create a hard link from existingPath to newPath. Both paths refer to the same inode; not available on all filesystems (e.g. some Windows volumes).
Basic usage
import { link } from '@vooya/fs'
await link('./existing.txt', './hardlink.txt')Methods
link(existingPath, newPath)
Async. Returns Promise<void>.
| Argument | Type | Description |
|---|---|---|
existingPath | string | Existing file path. |
newPath | string | New hard link path. |
linkSync(existingPath, newPath)
Sync. Same arguments; throws on error (e.g. EXDEV on cross-filesystem, or unsupported).
Performance
Single syscall; on par with Node.js. See Benchmarks.
Notes
- Filesystems: Hard links may not be supported (e.g. FAT, some network drives); same as Node.js.
- Directories: Typically not allowed for directories; use symlinks for directory “aliases”.
- Known gap: Missing-source and existing-destination errors currently have Node-like messages, but do not expose Node-style
code,path,dest, andsyscallfields yet. - Unsupported Node path inputs:
Bufferpaths andURLpaths are not part of the current Vooya FSlinksurface.
Competitor measurements
See the full link comparison table for Node 22/24, peer libraries, sync/Promise modes, small and batch workloads, execution routes and measurement limits.
Last updated on