var readline = require(‘readline’);
var rl = readline.createInterface({ input:process.stdin, output:process.stdout });
rl.question("what do you think of node.js?\n",function(answer){ console.log(answer); rl.close(); });
这个是几乎是照搬的nodejs上的例子,但是发现一个问题:
首先cmd会打印what do you think of node.js?这句话等我输入。 当我输入比如一个aaaa,然后我想删掉两个,是用退格键的时候,what do you think of node.js?这局话会再次打印,点一次退格键就会打印一次,请问这是为什么?谢谢
PS:顺便问一下,问题里想上传图片只能是用网络图片吗?我本地的截图怎么贴上来?