It seems that Node.js (version v0.10.13) returns the command wrapped between ( and \n), here's a minimal example:
require('repl').start({
'eval': function (cmd, context, filename, callback) {
callback(null, cmd);
}
});
The behavior is the following:
$ node repl.js
> asd
'(asd\n)'
>
Why is that? If this feature is documented then I was not able to find it.
Also, if this is the intended behavior, is there a better solution than doing cmd = cmd.slice(1, -2);?