Is there some URL from which I can download a given package from npm (as a tarball or something)? I need the exact files that were originally uploaded to npm.
Using npm install
gets a different, generated package.json for example. I want the exact original set of files that was published.
If you haven't installed npm, with the current public API, you can also access the information about a package in the npm registry from the URL https://registry.npmjs.org/<package-name>/ . Then you can navigate the JSON at versions > (version number) > dist > tarball to get the URL of the code archive and download it.
Use the npm CLI to directly inspect registry information using the npm view command and download the compressed tarball of an NPM package using the [ npm pack <packagename>@<version> ] command.
You can use npm view
to get the URL to the registry's tarball (in this example for the module level
):
$ npm view level dist.tarball
And to download tarball, you can use npm pack
:
$ npm pack level
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With