This not a very 'correct' way to use node.js, but i have some complex jQuery client-side code that is very easy to test via node.js: i just run 'node sometest.js' and tests are executed command-line without a need for a browser. Very handy.
But i can't execute my code that use jQuery events in node.js, since jQuery events are based on document object that is browser-specific and don't have any relationships with node.js on server side:
$( document ).bind( 'myevent', function( e, a ) { console.log( a ); } );
$( document ).trigger( 'myevent', [ 'foo' ] );
Is there some easy way to use jQuery events on node.js, or is it based on technologies completely alien to server side?
Found it, process can be used in jQuery in some cases instead of document or window. Works with events.