且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何“平"来自 Node.js 应用程序?

更新时间:2023-02-08 18:40:01

可以使用exec调用系统ping命令

You could use exec to call the system ping command

var sys = require('sys')
var exec = require('child_process').exec;
function puts(error, stdout, stderr) { sys.puts(stdout) }
exec("ping -c 3 localhost", puts);