Using 'require' in node.js to include functions from another file

I use nodeJS, and I put this in the head of the file main.js:

var par = require("C:/Us/ht");

In the ht.js file, I have a function called doJob().

When I then try the following code in main.js:

function cr(LTDa){
     par.doJob();
}

I get the following error:

Object #<Object> has no method 'doJob'

Where is my mistake?

You need to add the function as an attribute of the exports object, as documented here

In other words, your ht.js file should have the following code inside it:

exports.doJob = function() {
     //your code here
};