npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

reveal-file

0.1.2

@sindresorhus

npmHomeRepoSnykSocket
Downloads:301
$ npm install reveal-file
DailyWeeklyMonthlyYearly

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