brioche-dev / brioche-packages

Brioche packages, which get auto-published to the Brioche Registry
MIT License
20 stars 1 forks source link

Add implementation for `Brioche.download()` global function #75

Open kylewlacy opened 1 month ago

kylewlacy commented 1 month ago

Companion PR: brioche-dev/brioche#102

Part of brioche-dev/brioche#70

This PR adds an implementation for Brioche.download() on the Brioche global. Just like with the other functions for statics, the implementation is pretty simple and just uses the op_brioche_get_static op to do the heavy lifting

Here's an example snippet that could be used in the jq package:

const source = Brioche.download(
  "https://github.com/jqlang/jq/releases/download/jq-1.7.1/jq-1.7.1.tar.gz",
)
  .unarchive("tar", "gzip")
  .peel();

Left to do