Can I send commands using node.js?

I'm running a node.js server using Terminal (Mac) and want to be able to emit messages to the client via the command line. Is this possible? I could code the messages part of it no problem, it's more how I can send something directly from the server to the client rather than from the client-server-client relationship I only understand at the moment.

This is probably what you're after if not let me know and I'll delete answer.

Look into a module called Commander found here.

It will allow you to build up a cli that you can then hook into your methods/prototypes etc.

For Matt :)

var program = require('commander');
program.option('-s, --send', 'Send command');