explorer-opener
TypeScript icon, indicating that this package has built-in type declarations

1.0.1ย โ€ขย Publicย โ€ขย Published

explorer-opener

๐Ÿ“ Open file explorer with Node.js

npm-version build-status-badge install-size-badge codecov

Basic Usage

import { openExplorer } from 'explorer-opener';

openExplorer('C:\\Windows\\System32')
  .then(() => {
    // handle successful open
  })
  .catch((error) => {
    // handle error
  });

โš ๏ธ Rejected promise will be returned if provided path does not exist:

openExplorer('/test/folder').catch((error) => {
  // error: `File or directory "/test/folder" does not exist`
});

Default path values

Default values will be used if path is not specified:

  • Windows: "="
  • Linux: "/"
  • MacOS: "/"

Supported platforms

  • Windows ("win32")
  • Linux ("linux")
  • MacOS ("darwin")

โš ๏ธ Rejected promise will be returned if it's called from not supported platform:

// os: android
openExplorer().catch((error) => {
  // error: `Can not detect "android" platform`
});

Package Sidebar

Install

npm i explorer-opener

Weekly Downloads

74

Version

1.0.1

License

MIT

Unpacked Size

8.12 kB

Total Files

7

Last publish

Collaborators

  • goveo