🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more →
Socket
Book a DemoInstallSign in
Socket

gulp-wrap-factory

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-wrap-factory

wrap factory module

latest
Source
npmnpm
Version
1.2.1
Version published
Maintainers
1
Created
Source

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.

Keywords

gulpplugin

FAQs

Package last updated on 05 Jan 2016

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