Skip to content

Instantly share code, notes, and snippets.

@geNAZt
Created February 15, 2013 19:04
Show Gist options
  • Save geNAZt/4962552 to your computer and use it in GitHub Desktop.
Save geNAZt/4962552 to your computer and use it in GitHub Desktop.
var contextify = require('contextify');
ctx = contextify({console: console, setTimeout: setTimeout});
ctx.run("setTimeout(function() { now = 1; }, 1000);");
ctx.on("codeFinished", function() { //The context / vm tells me the code in it has finished computing
//ctx is now the state of the global object at the time the code has finished computing
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment