Created
August 10, 2012 20:18
-
-
Save aaronj1335/3317494 to your computer and use it in GitHub Desktop.
node.js repl
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
#!/usr/bin/env node | |
var repl = require('repl'), | |
fs = require('fs'), | |
path = require('path'), | |
vm = require('vm'); | |
var myrepl = repl.start('> '); | |
var stup = path.join(process.env.HOME, '.noderc'); | |
vm.runInContext(fs.readFileSync(stup).toString(), myrepl.context); | |
process.argv.slice(2).forEach(function(filename) { | |
vm.runInContext(fs.readFileSync(filename).toString(), myrepl.context); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment