0.3.0 • Published 10 years ago

gulp-wrap-exports v0.3.0

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

gulp-wrap-exports

Wrap CommonJS module in IIFE and create global variable

Install

npm install --save-dev gulp-wrap-exports

Example

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

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

Example input:

exports.processing = function(){};

Example output (name: 'module'):

!function(exports, global){
	global.module = exports;
	
	exports.processing = function(){};
	
}({}, function(){ return this; }());

Options

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

License

MIT License (c) Alexey Raspopov

0.3.0

10 years ago

0.2.0

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago