{"id":15616737,"url":"https://github.com/passy/google-cdn","last_synced_at":"2025-04-08T03:11:02.375Z","repository":{"id":8874919,"uuid":"10589899","full_name":"passy/google-cdn","owner":"passy","description":"Replaces references to resources on the Google CDN","archived":false,"fork":false,"pushed_at":"2022-12-08T00:57:27.000Z","size":1047,"stargazers_count":70,"open_issues_count":24,"forks_count":29,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-30T14:35:10.795Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/passy.png","metadata":{"files":{"readme":"readme.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-06-09T22:06:01.000Z","updated_at":"2022-12-13T21:23:24.000Z","dependencies_parsed_at":"2022-08-07T05:00:11.603Z","dependency_job_id":null,"html_url":"https://github.com/passy/google-cdn","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/passy%2Fgoogle-cdn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/passy%2Fgoogle-cdn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/passy%2Fgoogle-cdn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/passy%2Fgoogle-cdn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/passy","download_url":"https://codeload.github.com/passy/google-cdn/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247767236,"owners_count":20992548,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T07:21:42.869Z","updated_at":"2025-04-08T03:11:02.351Z","avatar_url":"https://github.com/passy.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# google-cdn [![Build Status](https://secure.travis-ci.org/passy/google-cdn.svg?branch=master)](http://travis-ci.org/passy/google-cdn) [![Code Climate](https://codeclimate.com/github/passy/google-cdn.svg)](https://codeclimate.com/github/passy/google-cdn)\n\n[![Greenkeeper badge](https://badges.greenkeeper.io/passy/google-cdn.svg)](https://greenkeeper.io/)\n\n\u003e Grunt task for replacing refs to resources on the [Google CDN](https://developers.google.com/speed/libraries/devguide).\n\nThis module makes it easy to replace references to your bower resources in your\napp with links to the libraries on the Google CDN (and some other CDNs).\n\n## Getting started\n\nInstall: `npm install --save google-cdn`\n\nInstall CDN data module: `npm install --save google-cdn-data` (see list of more [data modules](#cdn-data-modules) below)\n\n### Example\n\n*bower.json*:\n\n```json\n{\n  \"name\": \"my-awesome-app\",\n  \"dependencies\": {\n    \"jquery\": \"~2.0.0\"\n  }\n}\n```\n\n```javascript\nvar googlecdn = require('google-cdn');\n\nvar bowerConfig = loadJSON('bower.json');\nvar markup = '\u003cscript src=\"bower_components/jquery/jquery.js\"\u003e\u003c/script\u003e';\ngooglecdn(markup, bowerConfig, {cdn: require('google-cdn-data')}, function (err, result) {\n  if (err) {\n    throw err;\n  }\n\n  assert.equal(result,\n    '\u003cscript src=\"//ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js\"\u003e\u003c/script\u003e');\n});\n```\n\n## API\n\n### googlecdn(content, bowerJson[, options], callback)\n\nReplaces references to libraries supported by the Google CDN in `content`.\nThe library versions are inferred from the `bowerJson`.\n\n`options` is an optional object with these keys:\n\n  - `componentsPath`: defaults to `bower_components`, the path you specify in\n    your script tags to the components directory.\n  - `cdn`: defaults to `require('google-cdn-data')`. CDN you want to use. Object of the following format:\n\n  ```javascript\n  {\n    jquery: {\n      versions: ['2.0.3', '2.0.2', '2.0.1', '2.0.0'],\n      url: function (version) {\n        return '//my.own.cdn/libs/jquery/' + version + '/jquery.min.js';\n      }\n    }\n  }\n  ```\n\n## Used by\n\n- [grunt-google-cdn](https://github.com/btford/grunt-google-cdn)\n- [gulp-google-cdn](https://github.com/sindresorhus/gulp-google-cdn)\n\n## CDN data modules\n\n- [google-cdn-data](https://github.com/shahata/google-cdn-data)\n- [cdnjs-cdn-data](https://github.com/shahata/cdnjs-cdn-data)\n- [jsdelivr-cdn-data](https://github.com/shahata/jsdelivr-cdn-data)\n\n## Debugging\n\nYou can turn on debugging by setting the `DEBUG` environment variable to\n`google-cdn`. E.g.\n\n`env DEBUG='google-cdn' grunt cdnify`\n\n## License\n\nBSD\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpassy%2Fgoogle-cdn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpassy%2Fgoogle-cdn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpassy%2Fgoogle-cdn/lists"}