execa icon indicating copy to clipboard operation
execa copied to clipboard

Attach `.nodeChildProcess` to the execa promise

Open sindresorhus opened this issue 4 years ago • 11 comments

Node.js does this now for childProcess. when you promisify it.

https://nodejs.org/api/child_process.html#child_process_child_process_exec_command_options_callback

The name is to be decided.

One day, I hope we can get rid of execa() being both a childProcess and promise and just have the .child property on the promise. But that's a huge breaking change. For now, the best we can do is to add it, and recommend new users to use it instead of the old way. We could even un-document the old way.

@ehmicky Thoughts?

sindresorhus avatar Feb 16 '20 19:02 sindresorhus

Yes this sounds good :+1:

ehmicky avatar Feb 17 '20 11:02 ehmicky

Any thoughts on the name?

  • .child
  • .process
  • .subprocess
  • .childProcess

sindresorhus avatar Feb 17 '20 12:02 sindresorhus

.child since this is the name used by Node.js util.promisify(childProcess.exec)?

ehmicky avatar Feb 17 '20 12:02 ehmicky

👍

sindresorhus avatar Feb 17 '20 20:02 sindresorhus

@wesleytodd Based on your comment here, would you like to take a look at doing a PR for this feature? Please let us know if you need any help!

ehmicky avatar Feb 22 '20 19:02 ehmicky

I plan to, just have other priorities at work. If someone else gets to it before me that’s fine, my guess is I will be able to do it late next week at the earliest.

wesleytodd avatar Feb 22 '20 20:02 wesleytodd

Per this comment, we are going to name the property subprocess instead.

ehmicky avatar Mar 08 '24 21:03 ehmicky