Skip to content

Instantly share code, notes, and snippets.

@reu
Created April 16, 2014 17:35
Show Gist options
  • Save reu/10911441 to your computer and use it in GitHub Desktop.
Save reu/10911441 to your computer and use it in GitHub Desktop.
Self enclosing function for each file
var es = require("event-stream");
module.exports = function() {
return es.map(function(file, callback) {
file.contents = new Buffer("(function() {\n" + String(file.contents) + "\n})();");
callback(null, file);
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment