This package has been deprecated

Author message:

this package has been deprecated

gulp-jquery-closure

1.1.1 • Public • Published

gulp-jquery-closure NPM version Build Status Dependency Status

Enclose the content with jQuery definition and more

Usage

First, install gulp-jquery-closure as a development dependency:

npm install --save-dev gulp-jquery-closure
var concat = require('gulp-concat'),
    jqc = require('gulp-jquery-closure');
 
gulp.task('sample', function() {
  gulp.src('./sample.js')
    .pipe(jqc())
    .pipe(gulp.dest('./dist/'))
});
 
gulp.task('scripts', function() {
  gulp.src('./lib/*.js')
    .pipe(concat('all.js'))
    .pipe(jqc({$: false, window: true, document: true, undefined: true))
    .pipe(gulp.dest('./dist/'))
});

This will enclose the content defining some variable ($, window, document and undefined) depending on options as describe in jQuery plugin boilerplate.

Examples:

options: none

;(function ($) {
  /* content */
  })(jQuery);

options: {window: true, document: true, undefined: "undef"}

;(function ($, window, document, undef) {
  /* content */
})(jQuery, window, document);

Options

All parameters are optionals.

Parameter Type Default Description
$ bool|string true define $ for jQuery
window bool|string false define window (current window)
document bool|string false define document (current document)
undefined bool|string false define undefined from real undefined value
newLine string \n newLine separator

LICENSE

(MIT License)

Copyright (c) 2014 Jean-Baptiste DEMONTE jbdemonte@gmail.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Readme

Keywords

Package Sidebar

Install

npm i gulp-jquery-closure

Weekly Downloads

53

Version

1.1.1

License

none

Last publish

Collaborators

  • jbdemonte