我开始学习node.js.我通过阅读“The Node Beginner”一书开始,给出的代码似乎是为了在unix中运行而编写的,我不知道如何为下面给出的部分代码编写windows的等效代码。对于unix命令'ls -lah',等效的Windows命令提示符是什么?
var exec=require("child_process").exec;
function start(){
console.log("Request handler 'start' was called");
var content="empty";
exec("ls -lah", function(error, stdout, stderr){
content= stdout;
});
return content;
/*
function sleep(milliSeconds){
var startTime=new Date().getTime();
while(new Date().getTime()< startTime+milliSeconds);
}
sleep(10000);
return "Hello Start"; */
}
如果你曾经阅读过这本书,或者对如何使这段代码有用有任何想法,我将非常感激。
是'dir/w'你在找什么? – Joe
我会尽力...它可能是。 – L4reds
@Joe,当然是。非常感谢你。像魅力一样工作:D – L4reds