https://github.com/ybrusentsov/explorer-opener
📁 Open file explorer with Node.js
https://github.com/ybrusentsov/explorer-opener
Last synced: about 1 year ago
JSON representation
📁 Open file explorer with Node.js
- Host: GitHub
- URL: https://github.com/ybrusentsov/explorer-opener
- Owner: ybrusentsov
- License: mit
- Created: 2023-07-18T12:49:55.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2023-07-21T13:26:15.000Z (almost 3 years ago)
- Last Synced: 2025-03-09T01:01:51.594Z (over 1 year ago)
- Language: TypeScript
- Homepage:
- Size: 139 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# explorer-opener
📁 Open file explorer with Node.js



[](https://codecov.io/gh/goveo/explorer-opener)
## Basic Usage
```ts
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:
```ts
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:
```ts
// os: android
openExplorer().catch((error) => {
// error: `Can not detect "android" platform`
});
```