The require function in RESTApps

The require function is available in RESTApps

Requireables

// RESTApp-specific requireables
var
  _              = require('underscore'),
  router         = require('router'),
  appData        = require('appData'),
  appResource    = require('appResource'), // since 4.5.1
  appInfo        = require('appInfo'),     // since 4.5.3
  events         = require('events'),      // since 4.5.2

  myModule       = require('/module/nameOfModule');

The SiteVision Public API is also accessible server-side. All interfaces, classes and enums that are annotated with the @Requireable annotation is available via the require function.

// Requireable objects of the SiteVision Public API
var
  properties             = require('Properties'),  // since 4.5.2
  propertyUtil           = require('PropertyUtil'),
  resourceLocatorUtil    = require('ResourceLocatorUtil'),
  portletContextUtil     = require('PortletContextUtil'),
  permissionUtil         = require('PermissionUtil'),
  publishingUtil         = require('PublishingUtil'),
  versionUtil            = require('VersionUtil'),
  metadataUtil           = require('MetadataUtil'),
  metadataDefinitionUtil = require('MetadataDefinitionUtil'),
  outputUtil             = require('OutputUtil'),  
  userIdentityUtil       = require('UserIdentityUtil'),
  mimeTypeUtil           = require('MimeTypeUtil'),
  nodeIteratorUtil       = require('NodeIteratorUtil'),
  nodeTreeUtil           = require('NodeTreeUtil'),  
  nodeComparatorUtil     = require('NodeComparatorUtil'),
  nodeFilterUtil         = require('NodeFilterUtil'),
  nodeTypeUtil           = require('NodeTypeUtil'),
  localInboundRestApi    = require('RestApi'),
  ...