Download source from npm without installing it

AURIGADL picture AURIGADL · Feb 23, 2013 · Viewed 58.2k times · Source

How can I download the source code of a package from npm without actually installing it (i.e. without using npm install thepackage)?

Answer

Gustavo Rodrigues picture Gustavo Rodrigues · Jan 13, 2015

You can use npm view [package name] dist.tarball which will return the URL of the compressed package file.

Here's an example using wget to download the tarball:

wget $(npm view lodash dist.tarball)