CommonJS Module Approach

var compute = require('./compute.js');

exports.computeSomethingElse = function() {
}

Node.js Modules is an extension to CommonJS Modules (1.1).

Subscribe to My Newsletter

The latest programming-related news, articles and resources - sent to your inbox monthly. Unsubscribe anytime.