Skip to content

sindresorhus/reveal-file

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-file

Usage

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.pdf

Linux 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

About

Reveal a file in the system file manager (Finder, Explorer, etc.)

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors