【文件属性】:
文件名称:open-shortcut:从网络快捷方式文件中打开URL
文件大小:5KB
文件格式:ZIP
更新时间:2021-05-26 03:40:04
JavaScript
开放式快捷方式
在浏览器中打开文件中的URL
安装
$ npm install open-shortcut
用法
const openShortcut = require ( 'open-shortcut' ) ;
( async ( ) => {
await openShortcut ( 'google' ) ;
console . log ( 'URL opened in the browser' ) ;
} ) ( ) ;
在上面的示例中,它将查找以下文件:
macOS: google.webloc
Linux: google.desktop
Windows: google.url
原料药
openShortcut(filePath)
返回子进程的Promise。
文件路径
类型: string
Web快捷方式的文件路径。
省略扩展以实现跨平台兼容性。
有关的
【文件预览】:
open-shortcut-main
----.gitattributes(19B)
----.github()
--------workflows()
----test.js(241B)
----license(1KB)
----fixture()
--------google.desktop(99B)
--------google.webloc(247B)
--------google.url(42B)
----.npmrc(19B)
----.editorconfig(175B)
----.gitignore(23B)
----index.js(160B)
----readme.md(928B)
----package.json(654B)