Giter Site home page Giter Site logo

pioug / cdnjs-cdn-data-angular Goto Github PK

View Code? Open in Web Editor NEW

This project forked from laurent-le-graverend/google-cdn-data-angular

1.0 3.0 0.0 29 KB

Replace AngularJS references by libraries hosted on cdnjs

Home Page: https://npm.im/cdnjs-cdn-data-angular

License: MIT License

JavaScript 100.00%

cdnjs-cdn-data-angular's Introduction

cdnjs-cdn-data-angular

cdnjs data for google-cdn.

This module makes it easy to replace references in your app with links to the Angular libraries on the Google CDN.

Install

$ npm install --save-dev google-cdn cdnjs-cdn-data-angular

Usage

package.json:

{
  "name": "my-awesome-app",
  "dependencies": {
    "angular": "1.6.6"
  }
}
const googlecdn = require('google-cdn');
const fs = require('fs');
const assert = require('chai').assert;

const packageJson = JSON.parse(fs.readFileSync('package.json', 'utf8'));
const markup = '<script src="node_modules/angular/angular.js"></script>';

googlecdn(markup, packageJson, { cdn: require('cdnjs-cdn-data-angular') }, function(err, result) {
  if (err) {
    throw err;
  }
  assert.equal(result, '<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.6.6/angular.min.js"></script>');
});

Easy usage with gulp-google-cdn

const gulp = require('gulp');
const googlecdn = require('gulp-google-cdn');

gulp.task('default', function () {
  return gulp.src('index.html')
    .pipe(googlecdn(require('./package.json'), {
      componentsPath: 'node_modules',
      cdn: require('cdnjs-cdn-data-angular')
    }))
    .pipe(gulp.dest('dist'));
});

License

MIT

cdnjs-cdn-data-angular's People

Contributors

laurent-le-graverend avatar pioug avatar

Stargazers

 avatar

Watchers

 avatar  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.