Libraries

A library is a CommonJS library that can be loaded by triggers, jos, routes, and other library scripts. The format follows that of a common js module. A library is configured with an export property, the name that will be used to import into other scripts. The name follows the same c_ naming convention as the rest of the api.

module.exports = {
    foo: function() {
        return 'bar';
    }
}
function Thing() {
}
Thing.prototype.foo = 'bar';

module.exports.Thing = Thing;