UNPKG

@bowldevs/spawn

Version:

Describe your module here

3 lines (2 loc) 551 B
import{spawn as r}from"child_process";const o=["stdout","stderr"],t=async(t,n,e)=>new Promise((s,i)=>{const{stdout:c,stderr:a}=e,u=function(r,o){if(null==r)return{};var t={};for(var n in r)if({}.hasOwnProperty.call(r,n)){if(o.includes(n))continue;t[n]=r[n]}return t}(e,o),d=r(t,n,u);d.stdout.on("data",r=>{c&&"function"==typeof c&&c(r.toString())}),d.stderr.on("data",r=>{a&&"function"==typeof a&&a(r.toString())}),d.on("error",r=>{console.error("error",r),i(r)}),d.on("close",r=>{s(r)})});export{t as spawn}; //# sourceMappingURL=index.modern.js.map