/ Published in: JavaScript
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
// http://nodejs.org/api.html#_child_processes var sys = require('sys') var spawn = require('child_process').spawn; var filename = process.ARGV[2]; if (!filename) return sys.puts("Usage: node <server.js> <filename>"); var tail = spawn("tail", ["-f", filename]); sys.puts("start tailing"); tail.stdout.on("data", function (data) { sys.puts(data); }); // node tail.js development.log
URL: tail-log-output-with-node-js