node.js

Sending data from Node.js to Java over TCP

I'm trying to send messages (byte arrays) from Node.js to Java via TCP socket (serialized with protobuf). I create a server socket on the java side, and connect to it from Node: var client = net.craeteConnection(12345, "localhost") client.addListener("connect", function(){ client.write(serializedMsg1) client.end(serializedMsg...

How can I know, what local port is used by Stream?

Is it possible to specify explicitly local port that should be used by net.Stream, or to find out what local port is used for connection? According to the documentation, local port cannot be specified: stream.connect(port, host='127.0.0.1') ...

What is the best way to render LESS.js stylesheets in node.js using express?

I have a small node.js app (my first) that I want to have compile it's less.js stylesheets when the server loads. The point I'm starting at is the express example app for jade where it appears it compiles it's SASS templates when the server is created: var pub = __dirname + '/public'; var app = express.createServer( express.compiler...

How is event driven programming implemented?

I was looking on how the twisted and node.js frameworks work and I am trying to understand exactly how the operating system supports I/O operations using callbacks. I understand it's good because we need less threads because we don't need to have blocked threads waiting for I/O operations. But something has to call the callback once the...

Multiprocessor with v8 and node.js

I was reading that V8 isn't multithreaded, and can't be by design. Is this true? Is it really the case that I can have a script optimized to run concurrently (on node.js) but that concurrency can't extend to multiple processors? I kinda thought that was a major reason for a concurrent design. ...

require() a node.js module?

I have a node.js module like this: # couchdb.js var couchdb = { // code } module.exports = couchdb; How do I do to be able to use require("couchdb") in all my files? ...

Useful node.js middlewares

What is a node.js middleware / framework you personally found interesting / useful? ...

Node.js framework with sessions support in MongoDB

I am looking for a node.js framework which is capable of tracing user sessions via cookies/storage on the server side. Storage has to be in MongoDB ...

nodejs where to start?

I've installed nodejs and ran couple of simple examples like opening a server on a port and listen on that port. However, I still can not relate nodejs to web development. so to learn and implement nodejs I'm thinking about making tic tac toe using rails and nodejs. Is this possible? I'm envisioning a multi-player tic-tac-toe game w...

Nodejs: How to catch an exception from middleware?

I'm using node.js and the "less" compiler middleware: app.configure(function() { // ... app.use(express.compiler({ src: __dirname + '/public', enable: ['less'] })) // ... }) Now i've got a faulty .less-file, but I can't find any docs on how to get the error message. The page I receive is this: <html> <head> <title>[...