reveal-file
v0.1.0
Published
Reveal a file or folder in the system file manager (Finder, Explorer, etc.)
Downloads
168
Maintainers
Readme
reveal-file
Reveal a file or folder in the system file manager (Finder, Explorer, etc.)
Cross-platform utility to open the file manager and highlight a specific file or folder. Works on macOS, Windows, and Linux.
Install
npm install reveal-fileUsage
import revealFile from 'reveal-file';
await revealFile('/Users/sindresorhus/Documents/Unicorn.pdf');API
revealFile(filePath)
Reveals a file or folder in the system file manager.
Returns a Promise that resolves when the file manager has been opened.
filePath
Type: string | URL
The absolute path to the file or folder to reveal.
CLI
npm install --global reveal-file$ reveal-file
Usage: reveal-file <file> [<file> ...]
Example:
reveal-file ~/Documents/Unicorn.pdfLinux support
Supported file managers:
- Nautilus (GNOME)
- Dolphin (KDE)
- Caja (MATE)
- Thunar (XFCE)
- Nemo (Cinnamon)
Related
- open - Open stuff like URLs, files, executables
- open-editor - Open files in your editor at a specific line and column
