ravenblizzard
ravenblizzard

Reputation: 386

Download npm dist package without having to install npm

Is there a way I can download an npm package without having to do a npm view XXX ... or basically just not having to install node/npm? I'm trying to do this on a linux machine.

~EDIT~ I realize I should've added some clarification on what I'm trying to achieve here: all I need are the package's files with dependencies to be served as a static resource on cloudfront. I'm hoping npm provides a way to directly download the artefact like the way maven-central does.

Upvotes: 19

Views: 12106

Answers (2)

lleon
lleon

Reputation: 2765

You can access to the raw package using the NPM api.

https://registry.npmjs.org/{package-name}/{version}

The url above will give you a JSON response containing the package metadata. The package property dist.tarball contains an url where the package can be downloaded.

Keep in mind you have to install the dependencies of the package on your own

Example:

https://registry.npmjs.org/lodash/4.17.10


NPM API documentation

Upvotes: 42

Rock K
Rock K

Reputation: 97

Download lib folder from github.com-get all files within it

Put all the files next to your node application in the same folder. at the top of your file append it like sooo....

var "" = require("./""")

Upvotes: -2

Related Questions