6
Before we get into the weeds, here's an example of doing exactly this, just to see how it works:
$testNB =
URLDownload[
"https://raw.githubusercontent.com/b3m2a1/mathematica-tools/master/\
NotebookToPackage.nb",
FileNameJoin@{
$TemporaryDirectory,
"NotebookToPackage.nb"
}
...