Please use RobotJS instead!
This node.js module allows you to send keystrokes. Curently supports Mac OS X, Windows support is in the works.
Example:
This code sends the space key to the active application.
var keys = require('keys');
keys.send("49"); //49 is the keycode for space.