deepsweet / start

:red_circle: Functional task runner for Node.js
https://start.js.org/
MIT License
476 stars 19 forks source link

Add decompress plugin #33

Closed luii closed 6 years ago

luii commented 6 years ago

Added a new decompression plugin

deepsweet commented 6 years ago

Thanks 😍

I'll fix CI and tweak code a bit here and there. Most likely today.

deepsweet commented 6 years ago

What do you think about the following API?

sequence(
  find('dir/*.tar'),
  decompress({ /* options */ }),
  write('extracted/')
)

I see that it's possible to delegate writing functionality to write plugin and even have something like rename or whatever plugins in between (I know that there is a map option in decompress lib itself, but this flow doesn't feel natural in case of Start). Actually the only option we need from decompress is an array of plugins.

luii commented 6 years ago

Approved! I like this approach.

luii commented 6 years ago

How do you plan to do it?

deepsweet commented 6 years ago

Sorry for the long reply. I'll merge this almost as is for now. That idea with write plugin requires a lot more work than expected, and I don't want to block this PR.

In a few words Start is not fully ready to work effectively with binary (probably huge) data the way it works with text files. It's going to be changed soon, I found the elegant solution that needs to be tested.

deepsweet commented 6 years ago

Published as @start/plugin-unpack 🎉 Please let me know if there are some issues, I'll add real tests later.

luii commented 6 years ago

Okay!