Download source from npm without installing it

后端 未结 6 1531
既然无缘
既然无缘 2020-12-13 01:34

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

6条回答
  •  醉酒成梦
    2020-12-13 02:06

    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)
    

提交回复
热议问题