Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

deploy-azure-cdn

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

deploy-azure-cdn

A package that deploys a groupt of files to Azure CDN. Can be used with gulp.

  • 0.1.1
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

deploy-azure-cdn

A node package for copying a directory to Azure CDN storage. Also it provides a gulp plugin interface for easy deploy with (gulp)[http://gulpjs.com/]

Azure SDK uses by default the environment variables AZURE_STORAGE_ACCOUNT and AZURE_STORAGE_ACCESS_KEY. Custom connection arguments can be set in options.

Installing

npm install deploy-azure-cdn

Exported interface

  • gulpPlugin: function(deployOptions) - to use with gulp
  • vanilla: function(deployOptions, files, logger, cb) - to use directly in node.js

parameters:

  • deployOptions - azure cdn and upload configs
    • serviceOptions: [] - custom arguments to azure.createBlobService
    • containerName: null - container name, required
    • containerOptions: {publicAccessLevel: "blob"} - container options
    • folder: '', // path within container. Default is root directory of container
    • deleteExistingBlobs: true, // set it to false to skip recursive deleting blobs in folder
    • concurrentUploadThreads : 10, // number of concurrent uploads, choose best for your network condition
    • gzip: false, // true if want to gzip the files before uploading. File will be zipped only if compressed file is smaller than original
    • metadata: {cacheControl: 'public, max-age=31556926'} // metadata for each uploaded file
    • testRun: false, // set to true if you just want to check connectivity and see deployment logs. No blobs will be removed or uplaoded.
  • files: [] - array of files objects to be deployed
    • cwd - current working directory path
    • path - absolute path of file
  • logger - logger compatible with gutil.log(param1, param2...)
  • cb - node callback

Using in Gulp example

var deployCdn = require('gulp-deploy-azure-cdn');

gulp.task('upload-app-to-azure', function () {
    return gulp.src(['build/**/*'], {
        cwd: 'build'
    }).pipe(deployCdn.gulpPlugin({
        containerName: 'test',
        serviceOptions: ['<my azure cdn name>', '<my azure cdn secret>'],
        folder:  'build-0.0.1/',
        zip: true,
        deleteExistingBlobs: true,
        metadata: {
            cacheControl: 'public, max-age=31530000', // cache in browser
            cacheControlHeader: 'public, max-age=31530000' // cache in azure CDN. As this data does not change, we set it to 1 year
        }
    }))
});

Grunt plugin

See my other repository: https://github.com/bestander/grunt-azure-cdn-deploy. Code is very similar but less structured.

Keywords

FAQs

Package last updated on 20 Apr 2014

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc