Published at
Updated at
Reading time
1min

I came across the post npm init using written by Aral Balkan. He describes a command to download a GitHub repository using npm. But why should you use npm?

Occasionally, I google for this exact functionality. All I want is to git clone a repo but without downloading the complete git history. It turns out that doing that is not straightforward. You can open GitHub and press the "Download zip" button, but there doesn't seem to be a quick'n'easy way using git on the CLI.

Here's 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 provided 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.

npm init using gets the job done and is easy to remember. Thank you, Aral!

If you enjoyed this article...

Join 5.5k readers and learn something new every week with Web Weekly.

Web Weekly โ€” Your friendly Web Dev newsletter
Reply to this post and share your thoughts via good old email.
Stefan standing in the park in front of a green background

About Stefan Judis

Frontend nerd with over ten years of experience, freelance dev, "Today I Learned" blogger, conference speaker, and Open Source maintainer.

Related Topics

Related Articles