Skip to content

Instantly share code, notes, and snippets.

@billieblaze
billieblaze / event_extension.js
Created January 29, 2016 20:55 — forked from Fedia/event_extension.js
Extending Deployd Event's domain
(function(Script) {
var _run = Script.prototype.run;
Script.prototype.run = function(ctx, domain, fn) {
if (typeof domain === 'object') {
domain.require = function(module) {
return require(module);
};
domain.context = function() { // access Context via context()
return ctx;
};