@freik/node-utils
Version:
My personal set of utilities for NodeJS
2 lines (1 loc) • 437 B
JavaScript
import*as s from"child_process";import{MakeLog as f}from"@freik/logger";const{log:o}=f("node-utils:OpenLocalBrowser");function a(t){const i=/^darwin/.test(process.platform);!/^win/.test(process.platform)&&!i?o(`open a brower to ${t} to launch the application`):(t=(i?"open ":"start ")+t,o(t),s.exec(t,(e,n,r)=>{o("stdout: "+n.toString()),o("stderr: "+r.toString()),e!=null&&o(`exec error: ${JSON.stringify(e)}`)}))}export{a as default};