Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Command line helper for cdnjs.com

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 bin
Octocat-spinner-32 lib
Octocat-spinner-32 .gitignore
Octocat-spinner-32 HISTORY.md
Octocat-spinner-32 README.md
Octocat-spinner-32 cdnjs-command.gemspec
README.md

cdnjs-command

Command line helper for cdnjs.com.

This makes including JS files in your project easy-peasy. To add a JS libary to your project:

$ cdnjs jquery
Created jquery-1.5.1.js.

You probably want to link the online version as well:

$ cdnjs html jquery
<script src='https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js'></script>

Or you may want just the URL:

$ cdnjs url underscore
http://ajax.cdnjs.com/ajax/libs/underscore.js/1.1.4/underscore-min.js

Installation

This is a Ruby gem that requires Ruby 1.8+.

$ gem install cdnjs-command

Usage

Usage:
  cdnjs NAME       - Download specific package

Other commands:
  cdnjs list       - List available packages
  cdnjs info NAME  - Show package info
  cdnjs html NAME  - Show HTML snippet to include given package
  cdnjs url NAME   - Show the URL for the given package
  cdnjs update     - Updates the package cache

You may also use the first letters of each command; e.g., `cdnjs i jquery`.
Here are some common examples:

  $ cdnjs jquery
  $ echo `cdnjs h underscore` >> index.html

Acknowledgements

Something went wrong with that request. Please try again.