Parameters
NameTypeDescription
exportsobject

You should put inside this object all things that you want to expose from the library. For example:

var privateFunction = function(msg) {
  return '['+msg+']';
};

exports.logSomething = function(msg) { sys.logs.info(’*** logged from library: ‘+privateFunction(msg)); };

exports.MAX_AMOUNT = 50000;

In this case function logSomething and constant MAX_AMOUNT will be exposed and will be available at app.utils.logSomething() and app.utils.MAX_AMOUNT assuming that the name of the library is utils.

Samples
 
//library that exports function 'logSomething' and constant 'MAX_AMOUNT'
var privateFunction = function(msg) {
  return '['+msg+']';
};

exports.logSomething = function(msg) {
  sys.logs.info('*** logged from library: '+privateFunction(msg));
};

exports.MAX_AMOUNT = 50000;