-
-
Save billieblaze/e24be090d95c188100d8 to your computer and use it in GitHub Desktop.
Extending Deployd Event's domain
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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; | |
}; | |
} | |
_run.call(this, ctx, domain, fn); | |
} | |
})(require('deployd/lib/script')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment