gulp-jsonp

1.0.3 • Public • Published

Gulp JSONP plugin

Simple JSONP wrapper Gulp Plugin.

Installation   npm version

npm install gulp-jsonp

Simple Usage

var gjsonp = require("gulp-jsonp");
 
/**
 * Build JS
 */
gulp.task('js', function () {
  gulp.src(['./src/**/*.html'])
    .pipe(gjsonp({
        callback: "__myJSONPCallbackFunction",
        key: "optionalFilePrefix_"
      }))
    .pipe(gulp.dest('./dist/'));
});

Output

The plugin will rename files to have a .js extension, and wrap the contents in an object like so:

__myJSONPCallbackFunction({"filename":"optionalFilePrefix_index.html","contents":"[BASE64 ENCODED CONTENTS]"});

Readme

Keywords

Package Sidebar

Install

npm i gulp-jsonp

Weekly Downloads

1

Version

1.0.3

License

MIT

Last publish

Collaborators

  • alexei.white