gulp-self-execute
DEPRECATED: This package is no longer maintained
A Gulp plugin that wraps the contents of a JavaScript file with a self-executing anonymous function.
Install
Install via npm:
npm install --save-dev gulp-self-execute
Example
Suppose we want to wrap this code:
/* some masterpiece */
We run it through the plugin:
var gulp = ;var selfExecute = ; gulp;
And we get this:
{ /* some masterpiece */ }window jQuery;
API
selfExecute([options])
options
(optional) Array | Object | null - Specifies the arguments to be passed to the function and their corresponding parameter names.
If options
is a plain Object, its keys will be the arguments to be passed to
the function and its values the corresponding parameter names.
; // Becomes: {/* code */}arg1 arg2;
If options
is an Array, each element will identify both an argument
to be passed in and a parameter of the same name:
; // Becomes: {/* code */}thing1 thing2;
If options
is null, no arguments or parameters will be defined.
; // Becomes: {/* code */};
If options
is undefined, our arguments/parameters will default to
'window' and 'document'.
; // Becomes: {/* code */}window document;
License
Copyright © 2015 Akim McMath. Licensed under the MIT License.