Valentin Barral Valentin Barral - 11 months ago 97
Node.js Question

What is the difference between net.connect and net.createConnection in node.js?

I was reading the documentation from the net module in Node.js and I can't see any difference between the methods


Are they exactly the same or is there is some difference?

Answer Source

There's no difference. Here's an extract from the source code:

exports.connect = exports.createConnection = function() {

I agree the documentation isn't clear on that point.