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.
npm install reveal-file
import revealFile from 'reveal-file';
await revealFile('/Users/sindresorhus/Documents/Unicorn.pdf');
Reveals a file or folder in the system file manager.
Returns a Promise that resolves when the file manager has been opened.
Type: string | URL
The absolute path to the file or folder to reveal.
npm install --global reveal-file
$ reveal-file
Usage: reveal-file <file> [<file> ...]
Example:
reveal-file ~/Documents/Unicorn.pdf
Supported file managers: