-
-
Notifications
You must be signed in to change notification settings - Fork 214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
return the child process instead of a promise. #18
return the child process instead of a promise. #18
Conversation
We are guessing at the desired properties of the child-process object. Instead, why not just copy over `.then` and `.catch` from the promise to `spawned` and return that. This would allow stuff like this: ```js var spawned = execa('./cli.js'); spawned.stdin.write('foo'); spawned.stdin.end(); const {stdout} = await spawned; ```
This is pretty cool 👍 |
👍 That's a cool idea! I always forget you can thenify something. |
Can you update the docs? Mainly update what the methods return and remove |
Go ahead and merge #14. I'll update this once it's merged so |
Yes, absolutely. I was just getting this out there as an idea. It was easier to do a PR than open an issue in this case. |
@jamestalmage Go ahead and finish this. I'm not ready to merge #14 yet. Haven't decided whether #14 is worth the extra API bloat and overhead. |
I think it is. Specifically, if someone does
Will do |
Docs updated. |
We are guessing at the desired properties of the child-process object.
Instead, why not just copy over
.then
and.catch
from the promise tospawned
and return that.This would allow stuff like this: