This is an old revision of the document!

Back to Node.js

Available Node.js Functionality

Exposing Events

By default node js files only have scope within the same file. We can use the nodejs method “export” to export what ever we need to expose functions or variables

var x = 5;
var addX = function(value) {
  return value + x;
module.exports.x = x;
module.exports.addX = addX;
building_on_node_and_exposing_functionality.1354967460.txt.gz · Last modified: 2012/12/08 03:51 by admin
RSS - 200 © CrosswireDigitialMedia Ltd