Sign inSign up

euprogramador/npm-cdn

By euprogramador

•Updated over 10 years ago

cdn for npm resources

Image
1

1.1K

euprogramador/npm-cdn repository overview

⁠npm-cdn

A webservice that dishes out files from npm packages.

⁠Running

docker run -v /cdn-cache-folder:/cdn -p 8080:8080 euprogramador/npm-cdn

case run a server as sinopia npm server you can specify which server will connect via environment variable, NPM_HOST by default is used http://registry.npmjs.org/⁠. example:

docker run -v /cdn-cache-folder:/cdn -p 8080:8080 -e NPM_HOST=http://sinopia.myserver.local/⁠ euprogramador/npm-cdn

NOTE: You have the "/" end in url.

⁠Usage

To access a file inside a published npm package, use the following pattern:

http://myserver.com:8080/{packageName}@{packageVersion}/{filePath}

Examples:

⁠Indexes

When a package is downloaded, index files are generated in HTML and JSON format.

  • /[email protected]⁠ renders an HTML page with links to all the files in the package.
  • /[email protected]/?json⁠ returns a JSON array of all the files in the package. You can also set an application/json Accept header in the request instead of using the json query param.

⁠Redirects

If you request a package without specifying a version, you'll be redirected to the index for the latest version of the package:

Tag summary

Content type

Image

Digest

Size

256.9 MB

Last updated

over 10 years ago

docker pull euprogramador/npm-cdn