Is it possible to access other module export functions within the same file?

I have two functions in the same file, both accessed externally. One of the functions is called by the second.

module.exports.functionOne = function(param) {
    console.log('hello'+param);
};

module.exports.functionTwo = function() {
    var name = 'Foo';
    functionOne(name);
};

When this gets executed, the call to functionOne is flagged as not defined.

What's the right way to reference it?

One pattern I've found to work is by referencing the file itself.

var me = require('./thisfile.js');
me.functionOne(name);

... but it feels like there has to be a better way.

Just simply module.exports.functionOne().

If that's too cumbersome, just do the following:

function fnOne() {
    console.log("One!");
}

module.exports.fnOne = fnOne;

I guess I've been thinking of require is an equivalent of include, import, etc. If there is another way around it, it might be interesting to see it. I'm still wet behind the ears with node.

James Herdmans Understanding Node.js "require" post really helped me when it came to helping with code organization. Its definitely worth a look!

// ./models/customer.js
Customer = function(name) {
  var self = this;
  self.name = name;

};

// ./controllers/customercontroller.js
require("../models/customer");

CustomerController = function() {
  var self = this;

  var _customers = [
   new Customer("Sid"),
   new Customer("Nancy")
  ];
  self.get() {
   return _customers;
  }
};

var me = require(module.filename);
me.functionOne(name);

or just use exports object itself

module.exports.functionOne(name);