1616 < title >
1717 how to download a github directory
1818 </ title >
19+
1920 < meta name =description content ='Learn how to download a specific directory from any GitHub repository without cloning the entire project. This guide walks developers through fast, efficient methods using browser tools and custom scripts. '>
2021
21-
22- < link rel =icon type ='image/png ' href ='/blog/image/blog-30.png '>
23- < meta name =viewport content ='width=device-width, initial-scale=1 '>
24-
25-
2622 < base href ='https://ext-code.com/blog/25-08-27/how-to-download-a-github-directory/ '>
2723 < link rel =canonical href ='https://ext-code.com/blog/25-08-27/how-to-download-a-github-directory/how-to-download-a-github-directory.html '>
28-
24+
25+ < link rel =icon type ='image/png ' href ='/blog/image/blog-30.png '>
26+ < meta name =viewport content ='width=device-width, initial-scale=1 '>
2927
3028 < script type ='application/ld+json '>
31-
3229 {
3330 "@context" : "https://schema.org" ,
3431 "@type" : "TechArticle" ,
4037 "mainEntityOfPage" : { "@type" :"WebPage" , "@id" :"https://ext-code.com/blog/25-08-27/how-to-download-a-github-directory/how-to-download-a-github-directory.html" } ,
4138 "publisher" : { "@type" :"Organization" , "name" :"ext-code.com" , "logo" :{ "@type" :"ImageObject" , "url" :"https://ext-code.com/favicon.ico" } } ,
4239 }
43-
4440 </ script >
4541
4642
5955 console . log ( 'how-to-download-a-github-directory.html' ) ;
6056 console . log ( ) ;
6157 console . json = v => console . log ( JSON . stringify ( v , null , 4 ) ) ;
62- var version = 'v1.0' ;
63-
64- var df = true
58+ var df = true , version = 'v2.0'
6559 ;
6660
67-
61+ var ace ;
62+
6863 var ext ;
6964 var $ ;
7065 var datatype ;
7166 var menumod ;
72- var code ;
67+ var keydown ;
7368 var debug ;
7469
7570
8176 snippet [ 'node-1' ] = null ;
8277 snippet [ 'node-2' ] = null ;
8378
79+ var log ;
8480
8581
8682 //:
9793 snippet [ 'node-1' ] = mod [ 'node-1' ] ;
9894 snippet [ 'node-2' ] = mod [ 'node-2' ] ;
9995
96+ log = mod . log ;
10097
10198
10299 snippet [ 'full-ex' ] . initmod ( { ext, $, menu, ace} ) ;
103100 snippet [ 'data-structure' ] . initmod ( { ext, $, menu, ace} ) ;
104101 snippet . zip . initmod ( { ext, $, menu, ace} ) ;
105102 snippet [ 'node-1' ] . initmod ( { ext, $, menu, ace} ) ;
106103 snippet [ 'node-2' ] . initmod ( { ext, $, menu, ace} ) ;
104+ log . initmod ( { ext, $} ) ;
107105
108106
109107 await Promise . all ( [
112110 snippet . zip . init ( ) ,
113111 snippet [ 'node-1' ] . init ( ) ,
114112 snippet [ 'node-2' ] . init ( ) ,
113+ log . init ( ) ,
115114 ] ) ;
116115
117116
136135 'js/core/datatype.js' ,
137136 'js/dom/menumod/menumod.js' ,
138137 'js/dom/keydown/keydown.js' ,
139- 'js/dom/code/v2.0/code-v2.0.js.api' ,
140138 'js/debug/debug.js' ,
141139 ) ;
142- [ $ , datatype , menumod , keydown , code , debug ] = await promise ;
140+ [ $ , datatype , menumod , keydown , debug ] = await promise ;
143141
144- code . initmod ( { ext, $, datatype, menumod} ) ;
145-
146142 mod . stack . complete ;
147143
148144} ) ( ) ;
@@ -238,8 +234,7 @@ <h1 class=title>
238234 </ p >
239235
240236
241- < snippet-html-console id =full-ex component v2.0 h =100 src ='ex/full-ex.html '>
242- </ snippet-html-console >
237+ < snippet-html-console id =full-ex component v2.0 h =100 src ='ex/full-ex.html '> </ snippet-html-console >
243238
244239
245240 < p >
@@ -306,8 +301,7 @@ <h1 class=title>
306301
307302 </ p >
308303
309- < snippet-console id =data-structure component v2.0 src ='ex/data-structure.js '>
310- </ snippet-console >
304+ < snippet-console id =data-structure component v2.0 src ='ex/data-structure.js '> </ snippet-console >
311305
312306 < p >
313307
@@ -321,26 +315,23 @@ <h1 class=title>
321315
322316 </ p >
323317
324- < snippet-html-console id =zip component v2.0 src ='ex/zip.html '>
325- </ snippet-html-console >
318+ < snippet-html-console id =zip component v2.0 src ='ex/zip.html '> </ snippet-html-console >
326319
327320 < p >
328321
329322 For those wishing to do all this in nodejs, the following will write directly to disk
330323
331324 </ p >
332325
333- < snippet-terminal-console id =node-1 type =nodejs component v2.0 src ='ex/download-repo-dir.node.mjs '>
334- </ snippet-terminal-console >
326+ < snippet-terminal-console id =node-1 type =nodejs component v2.0 src ='ex/download-repo-dir.node.mjs '> </ snippet-terminal-console >
335327
336328 < p >
337329
338330 To get jszip working in nodejs this seems to work
339331
340332 </ p >
341333
342- < snippet-terminal-console id =node-2 type =nodejs component v2.0 src ='ex/nodejs-zip.js '>
343- </ snippet-terminal-console >
334+ < snippet-terminal-console id =node-2 type =nodejs component v2.0 src ='ex/nodejs-zip.js '> </ snippet-terminal-console >
344335
345336 < p >
346337
@@ -386,7 +377,7 @@ <h1 class=title>
386377 //:
387378
388379
389- async function initdom ( rootnode ) {
380+ function initdom ( rootnode ) {
390381
391382 root = rootnode ;
392383
@@ -426,8 +417,7 @@ <h1 class=title>
426417
427418
428419 </ script >
429-
430-
420+
431421</ html >
432422
433423
0 commit comments