remove roadrunner from 6to5-node
This commit is contained in:
parent
0cbcbc60de
commit
bb19f24923
@ -1,14 +1,13 @@
|
|||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
|
|
||||||
var roadrunner = require("roadrunner");
|
var commander = require("commander");
|
||||||
var commander = require("commander");
|
var Module = require("module");
|
||||||
var Module = require("module");
|
var path = require("path");
|
||||||
var path = require("path");
|
var repl = require("repl");
|
||||||
var repl = require("repl");
|
var to5 = require("../lib/6to5");
|
||||||
var to5 = require("../lib/6to5");
|
var util = require("../lib/6to5/util");
|
||||||
var util = require("../lib/6to5/util");
|
var vm = require("vm");
|
||||||
var vm = require("vm");
|
var _ = require("lodash");
|
||||||
var _ = require("lodash");
|
|
||||||
|
|
||||||
var program = new commander.Command("6to5-node");
|
var program = new commander.Command("6to5-node");
|
||||||
|
|
||||||
@ -18,23 +17,19 @@ program.option("-i, --ignore [regex]", "Ignore all files that match this regex w
|
|||||||
program.option("-x, --extensions [extensions]", "List of extensions to hook into [.es6,.js]");
|
program.option("-x, --extensions [extensions]", "List of extensions to hook into [.es6,.js]");
|
||||||
program.option("-r, --experimental", "Enable experimental support for proposed ES7 features");
|
program.option("-r, --experimental", "Enable experimental support for proposed ES7 features");
|
||||||
program.option("-g, --playground", "Enable playground support");
|
program.option("-g, --playground", "Enable playground support");
|
||||||
program.option("-c, --cache", "Cache compiled files and require paths");
|
|
||||||
|
|
||||||
var pkg = require("../package.json");
|
var pkg = require("../package.json");
|
||||||
program.version(pkg.version);
|
program.version(pkg.version);
|
||||||
program.usage("[options] [ -e script | script.js ] [arguments]");
|
program.usage("[options] [ -e script | script.js ] [arguments]");
|
||||||
program.parse(process.argv);
|
program.parse(process.argv);
|
||||||
|
|
||||||
if (program.cache) roadrunner.load();
|
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
||||||
to5.register({
|
to5.register({
|
||||||
experimental: program.experimental,
|
experimental: program.experimental,
|
||||||
extensions: program.extensions,
|
extensions: program.extensions,
|
||||||
playground: program.playground,
|
playground: program.playground,
|
||||||
ignore: program.ignore,
|
ignore: program.ignore
|
||||||
cache: program.cache && roadrunner.get("6to5")
|
|
||||||
});
|
});
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -79,8 +74,6 @@ if (program.eval) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (program.cache) roadrunner.save();
|
|
||||||
|
|
||||||
function replStart() {
|
function replStart() {
|
||||||
repl.start({
|
repl.start({
|
||||||
prompt: "> ",
|
prompt: "> ",
|
||||||
@ -100,6 +93,8 @@ function replEval(code, context, filename, callback) {
|
|||||||
code = code.slice(1, -2); // remove "(" and "\n)"
|
code = code.slice(1, -2); // remove "(" and "\n)"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log(JSON.stringify(code));
|
||||||
|
|
||||||
result = _eval(code, filename);
|
result = _eval(code, filename);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
err = e;
|
err = e;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user