Git Product home page Git Product logo

cdnjs's Introduction

Build Status

cdnJS Script Repository

The repository mirroring all scripts on cdnjs.cloudflare.com, created and maintained by Thomas Davis, Ryan Kirkman and Lachlan Collins

We will host any version of any library. Feel free to add a pull request for an older version of a library if your site still uses it.

Libraries must have notable popularity. 100 stars on GitHub is a good example, but as long as reasonably popularity can be demonstrated the library will be added.

Extensions, Plugins, Resources

Extensions, Plugins, Resources

Conventions

  • Filenames should not include version number and be lowercase
  • Javascript & Css files should be minified, If the library doesn't already provide a minified version, our preferred minifier is UglifyJS
  • If updating an existing library, try to keep consistent with the existing structure

Pull requests steps

  1. Fork this repository
  • Install all the needed dependencies locally (you will need node): npm install
  1. Add your library (following the conventions of this repository)
  • 1 commit per pull request
  • 1 library per pull request
  • The files in the pull request must correspond to a tag in the original repository (some exceptions apply)
  • include a package.json in the npm format (see test/schemata/npm-package.json for details - it's very simple)
  • Run npm test to check everything is ok
  1. Send us a pull request.
  • If you are the author of the library, add [author] to the pull request title
  • Make sure you include in the pull description:
    1. Where you downloaded the script
    2. If it isn't clear, how you found the version of the script
  • e.g. cdnjs#541
  1. If the library doesn't already provide a minified version, our preferred minifier is UglifyJS

Enabling NPM auto update

We automatically update libraries that are also hosted on NPM e.g. Lodash.

  1. Update the package.json and configure it as below and submit a pull request.
 // Lodash package.json
 // ...
  "npmName": "lodash",
  "npmFileMap": [{
    "basePath": "/dist/",
    "files": [
      "*"
    ]
  }],
  // ...

npmName should map to the name of the library on NPM npmFileMap is a white list of files to take from the NPM tarball and host on the cdn. basePath will be ignored when copying over to the cdn files is a pattern matcher that you can select many files with

The above example looks in the tarball whose structure might look like

- dist/lodash.js
- dist/lodash.min.js
- README

It then will look for dist/* which will find the two files inside the dist folder. It will now copy it over to cdnjs but without the dist path. Such that they will end up. ajax/libs/lodash.js/2.0/lodash.js

Running the validator

  1. Install all the needed dependencies locally (you will need node): npm install
  2. Run the test suite: npm test

cdnjs's People

Contributors

agourlay avatar alfredwassermann avatar codler avatar drewfreyling avatar emmenko avatar erichiggins avatar eryx avatar flowersinthesand avatar gfranko avatar gladson avatar jackdoyle avatar jdalton avatar jensarps avatar koggdal avatar kroman0 avatar leonardehrenfried avatar lockyc avatar mattpodwysocki avatar meltingice avatar moderation avatar pwnall avatar robert-hoffmann avatar rwjblue avatar ryankirkman avatar scotteadams avatar thomasdavis avatar webhat avatar wittemann avatar wyuenho avatar xrmx avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.