Socket
Book a DemoInstallSign in
Socket

npm-cdn

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

npm-cdn

A webservice that dishes out files from npm packages

latest
Source
npmnpm
Version
2.0.0
Version published
Maintainers
1
Created
Source

npm-cdn

A webservice that dishes out files from npm packages.

npm-cdn downloads tarballs from the npm registry and stores them on disk. First-time requests for a package are slow because the entire package tarball has to be fetched, but subsequent requests for files in the same package should be pretty fast.

Caveat npmtor: This is a proof of concept app. It works, but it's experimental. It's running on a single Heroku dyno so it won't scale. To become a real thing it will need to sit behind a CDN.

Usage

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

https://npm-cdn.herokuapp.com/{packageName}@{packageVersion}/{filePath}

Examples:

  • /dat@6.8.6/img/dat-website.png
  • /express@4.10.4/package.json
  • /zeke.sikelianos.com@1.0.0/assets/images/hands.png

Indexes

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

  • /browserify@8.1.1 renders an HTML page with links to all the files in the package.
  • /browserify@8.1.1/?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:

Tests

npm install
npm test

Dependencies

  • request: Simplified HTTP request client.
  • restify: REST framework
  • tar-fs: filesystem bindings for tar-stream

Dev Dependencies

  • mocha: simple, flexible, fun test framework
  • nixt: Simple and powerful testing for command-line apps
  • nodemon: Simple monitor script for use during development of a node.js app.
  • rimraf: A deep deletion module for node (like rm -rf)

License

ISC

Generated by package-json-to-readme

Keywords

npm

FAQs

Package last updated on 21 Jan 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts