shell(殼)

使用預設應用程式管理檔案和 URL。

shell 模組提供與桌面整合相關的功能。


方法

beep()

播放系統嗶嗶的提示聲音。

  • 返回 Promise<void>

await eagle.shell.beep();

openExternal(url)

使用系統預設方式開啓指定 URL。注意:如果系統沒有設定預設應用,此功能將不會有任何反應。

  • url string - 欲開啓之URL

  • 返回 Promise<void>

await eagle.shell.openExternal('https://www.google.com/');

openPath(path)

使用系統預設方式開啓指定路徑。

  • path string - 欲開啓檔案路徑

  • 返回 Promise<void>

await eagle.shell.openPath('path_to_file');

showItemInFolder(path)

在檔案管理器中顯示指定的檔案、資料夾。

  • path string - 欲顯示指定的檔案、資料夾

  • 返回 Promise<void>

await eagle.shell.showItemInFolder('path_to_file_or_directory');

最后更新于