1.2.1 • Published 10 years ago

gulp-wrap-factory v1.2.1

Weekly downloads
1
License
MIT
Repository
github
Last release
10 years ago

gulp-wrap-factory

Wrap Factory module

Install

npm install --save-dev gulp-wrap-factory

Example

var gulp = require('gulp'),
    wrap = require('gulp-wrap-factory');

gulp.task('default', function(){
    return gulp.src('fn-module.js')
        .pipe(wrap({ name: 'Base' }))
        .pipe(gulp.dest('dest/'));
});

Example input:

// my coding goes here.
console.info(this, window, document);

Example output (name: 'Base'):

(function (global, factory) {
    if (typeof exports !== "undefined") {
        module.exports = factory;
    } else {
        global.Base = factory;
    }
})(this, function (window, document) {
    (function () {
        // my coding goes here.
        console.info(this, window, document);
    }).call(window)
});

Options

String name - valid name of global variable which should be available in browser.

1.2.1

10 years ago

1.2.0

10 years ago

1.1.0

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago