-
Notifications
You must be signed in to change notification settings - Fork 48
Node Modules
Lazo uses RequireJS (AMD) for loading application modules to help normalize the
loading of modules between the client and the server. Node uses require
, which follows the
CommonJS format. RequireJS will delegate to
Node's require
in the event that it cannot find a module. Node require
will attempt to resolve modules
from the script that started the process by traversing up the directory tree. In this case the script
that started the process is Lazo which resides where the Lazo node module was installed.
If a server module fails to load the Lazo loader will make a few different attempts to
load the module using Node require
. For instance, if you have a node module in app/server/node_modules/some_module
the loader will expand the path from app/server/some_module
to ABSOLUTE_ PATH/app/server/some_module
.
If that fails it will try ABSOLUTE_PATH/app/server/node_modules/some_module
.
If a node module is global and
$NODE_PATH
is set then it can be loaded by id. Node core modules can also be loaded by id.
Overview
Life Cycles
Getting Started
Development Tools
Application Structure
application.js
Configuration
Configuration Providers
Logging
Module Loader
Assets
Combo Handling
Components
Models and Collections
Views
Templates
Layouts
Imports
Links
Request Filters
Crumb
Server Setup
Error Templates
Page Template
Server Utilities
Node Modules
Contributing