cpx icon indicating copy to clipboard operation
cpx copied to clipboard

[Feature] Promise-based API?

Open dominique-mueller opened this issue 6 years ago • 2 comments

Right now, cpx can be used either synchronously, or asynchronously using callbacks. With the trend in the world of NodeJS to move to native Promises - what about providing a promise-based API?

Perhaps something like copyAsync? Or replacing the copy and introducing a breaking change?

dominique-mueller avatar May 24 '18 20:05 dominique-mueller

This would be a great addition, especially with async/await being the norm these days.

This probably wouldn't need a breaking change since you can just drop the last callback parameter in copy and it will treat it as if a Promise is expected.

cypherix93 avatar Mar 04 '19 15:03 cypherix93

Would be awesome to prevent a callback-hell! Personally I would prefer to additionally to copy that returns a promise to have copySync, too.

MickL avatar Jun 18 '21 16:06 MickL