This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var spawn = require('child_process').spawn; | |
var stdin = process.openStdin(); | |
var reader = spawn('wmiir', ['read', '/event']); | |
reader.stdout.on('data', function(data) { | |
console.log("Got event: " + data); | |
}); | |
console.log("Press ENTER to exit."); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var spawn = require('child_process').spawn; | |
// Spawns and returns a child process that runs `wmiir read`. | |
// The callback takes two parameters: (err, line). | |
// It is called once for each line in the file read. | |
// - err is any error that occurred, or null if no error occurred. | |
// - line is the last line read from the file. | |
exports.read = function(path, callback) { | |
// Start the process. | |
var child = spawn('wmiir', ['read', path]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// wmiir controller module | |
// Adam R. Nelson | |
// August 2013 | |
var spawn = require('child_process').spawn; | |
// Spawns and returns a child process that runs `wmiir read`. | |
// The callback takes two parameters: (err, line). | |
// It is called once for each line in the file read. | |
// - err is any error that occurred, or null if no error occurred. |
NewerOlder