How can I download the source code of a package from npm without actually installing it (i.e. without using npm install thepackage)?
npm install thepackage
You can use npm view [package name] dist.tarball which will return the URL of the compressed package file.
npm view [package name] dist.tarball
Here's an example using wget to download the tarball:
wget
wget $(npm view lodash dist.tarball)
2.1m questions
2.1m answers
60 comments
57.0k users