使用用户默认程序打开网站、文件、可执行文件等优点:支持应用参数,更安全,因为它使用spawn而不是exec跨平台安装:npminstallopnUsage:constopn=require('opn')//在默认图像程序中打开图像opn('unicorn.png')。then(()=>{//图片查看器关闭});//使用默认浏览器打开URLopn('http://sindresorhus.com');//打开指定应用程序的URLopn('http://sindresorhus.com',{app:'firefox'});//指定浏览器参数打开网址opn('http://sindresorhus.com',{app:['googlechrome','--incognito']});opn(target,[options])targettype:string你想要打开的东西。可以是URL、文件或可执行文件。在默认应用程序中打开文件类型。例如,URL在默认浏览器中打开。optionstype:Object指定一个包含app和app参数的数组
