🚀 Launch Week Day 2:Introducing Custom Tabs for Org Alerts.Learn More →
Socket
Book a DemoInstallSign in
Socket

open-file-manager-dialog

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

open-file-manager-dialog

Cross-platform library for opening a file manager dialog window programmatically on MacOS, Windows, or Linux.

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

open-file-manager-dialog NPM version NPM monthly downloads NPM total downloads

Cross-platform library for opening a file manager dialog window programmatically on MacOS, Windows, or Linux.

Please consider following this project's author, Jon Schlinkert, and consider starring the project to show your :heart: and support.

Install

Install with npm:

$ npm install --save open-file-manager-dialog

Usage

import { openFileManagerDialog, parsePaths } from 'open-file-manager-dialog';
// or
import openFileManagerDialog from 'open-file-manager-dialog';

API

Signature:

export const openFileManagerDialog = async (
  dirname?: string,
  options?: { multiple?: boolean; filter?: string; }
): Promise<string[]>;

This library is powered by open-finder-dialog, open-linux-file-dialog, and open-windows-file-dialog. See their documentation for more details and to learn about available options.

Usage

// Open the dialog in the current working directory
const selectedPaths = await openFileManagerDialog();
console.log('Selected paths:', selectedPaths);

Opens the native file manager dialog for the current OS (Windows, macOS, or Linux) to select files or directories. Returns the paths of selected files as an array of strings.

Params

dirname (optional)

The initial directory or file path where the dialog should open. Defaults to the current working directory.

const selectedPaths = await openFileManagerDialog('/some/folder');

options (optional)

  • multiple (boolean): Allow selection of multiple files (default: false).
  • filter (string): Filter file types, for example "*.jpg".
// Allow selecting multiple PDF files from a directory
const { files, canceled } = await openFileManagerDialog('/some/folder', {
  multiple: true,
  filter: ['pdf']
});

You might also be interested in:

About

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Running Tests

Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:

$ npm install && npm test
Building docs

(This project's readme.md is generated by verb, please don't edit the readme directly. Any changes to the readme must be made in the .verb.md readme template.)

To generate the readme, run the following command:

$ npm install -g verbose/verb#dev verb-generate-readme && verb

Author

Jon Schlinkert

License

Copyright © 2025, Jon Schlinkert. Released under the MIT License.

This file was generated by verb-generate-readme, v0.8.0, on May 25, 2025.

Keywords

dialog

FAQs

Package last updated on 25 May 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts