How to download a GitHub repo without the git history using npm (#snippet)

I came across the post npm init using written by Aral Balkan. He describes a command to download a GitHub repository using npm. Occasionally, I google for this exact functionality, and it turns out that it’s not straightforward. You…


This content originally appeared on Stefan Judis Web Development and was authored by Stefan Judis

I came across the post npm init using written by Aral Balkan. He describes a command to download a GitHub repository using npm. Occasionally, I google for this exact functionality, and it turns out that it's not straightforward. You can open GitHub and press the "Download zip" button, but there doesn't seem to be a quick'n'easy way to do it on the CLI.

Aral's command:

# download small-tech/site-vite-svelte without `.git` dir
npm init using small-tech/site-vite-svelte my-site

Huh – is this functionality possible by npm?

Disclaimer: it is not. ? Aral took advantage of how npm init works and published a create-using package. If you want to learn how this works, head over and read his post.


Reply to Stefan


This content originally appeared on Stefan Judis Web Development and was authored by Stefan Judis


Print Share Comment Cite Upload Translate Updates
APA

Stefan Judis | Sciencx (2021-04-02T22:00:00+00:00) How to download a GitHub repo without the git history using npm (#snippet). Retrieved from https://www.scien.cx/2021/04/02/how-to-download-a-github-repo-without-the-git-history-using-npm-snippet/

MLA
" » How to download a GitHub repo without the git history using npm (#snippet)." Stefan Judis | Sciencx - Friday April 2, 2021, https://www.scien.cx/2021/04/02/how-to-download-a-github-repo-without-the-git-history-using-npm-snippet/
HARVARD
Stefan Judis | Sciencx Friday April 2, 2021 » How to download a GitHub repo without the git history using npm (#snippet)., viewed ,<https://www.scien.cx/2021/04/02/how-to-download-a-github-repo-without-the-git-history-using-npm-snippet/>
VANCOUVER
Stefan Judis | Sciencx - » How to download a GitHub repo without the git history using npm (#snippet). [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/04/02/how-to-download-a-github-repo-without-the-git-history-using-npm-snippet/
CHICAGO
" » How to download a GitHub repo without the git history using npm (#snippet)." Stefan Judis | Sciencx - Accessed . https://www.scien.cx/2021/04/02/how-to-download-a-github-repo-without-the-git-history-using-npm-snippet/
IEEE
" » How to download a GitHub repo without the git history using npm (#snippet)." Stefan Judis | Sciencx [Online]. Available: https://www.scien.cx/2021/04/02/how-to-download-a-github-repo-without-the-git-history-using-npm-snippet/. [Accessed: ]
rf:citation
» How to download a GitHub repo without the git history using npm (#snippet) | Stefan Judis | Sciencx | https://www.scien.cx/2021/04/02/how-to-download-a-github-repo-without-the-git-history-using-npm-snippet/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.