Created
June 26, 2013 15:32
-
-
Save aslushnikov/5868416 to your computer and use it in GitHub Desktop.
running CodeMirror modes in node
This file contains 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
var vm = require('vm') | |
, fs = require('fs') | |
CodeMirror = require('./runmode.node.js'); | |
var text = fs.readFileSync("./javascript.js", "utf-8"); | |
vm.runInThisContext(text); | |
CodeMirror.runMode("var i = 0;", "text/javascript", function() { | |
console.log(arguments); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment