File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,6 +6,9 @@ type AnyKey<T> = T & {
66 [ key : string ] : T
77} ;
88
9+ type AsyncifiedObject < T > = {
10+ [ P in keyof T ] : Promise < T [ P ] >
11+ }
912type AnyFunction = ( ...args : any ) => any ;
1013type Tail < T extends any [ ] > =
1114 ( ( ...args : T ) => void ) extends ( ( firstArg : any , ...restOfArgs : infer R ) => void ) ? R : never ;
@@ -25,7 +28,7 @@ type ExecResult = {
2528 stderr : string ,
2629}
2730
28- type AttachedPromise < T > = Promise < T > & { _child : ChildProcess }
31+ type AttachedPromise < T > = Promise < T > & AsyncifiedObject < T > & { _child : ChildProcess }
2932type ExecFunction = ( ...args : ExecParameters ) => ExecResult ;
3033type ExecAsyncFunction = ( ...args : ExecParameters ) => AttachedPromise < ExecResult > ;
3134
@@ -93,6 +96,9 @@ function execAsync(
9396 } ) as AttachedPromise < ExecResult > ;
9497
9598 promise . _child = childProcess ;
99+ promise . status = promise . then ( result => result . status ) ;
100+ promise . stdout = promise . then ( result => result . stdout ) ;
101+ promise . stderr = promise . then ( result => result . stderr ) ;
96102 return promise ;
97103}
98104
Original file line number Diff line number Diff line change 11{
22 "name" : " @markjm/execr" ,
3- "version" : " 1.5 .0" ,
3+ "version" : " 1.6 .0" ,
44 "description" : " Utility to streamline exec calls" ,
55 "main" : " execr.js" ,
66 "types" : " execr.d.ts" ,
You can’t perform that action at this time.
0 commit comments