Require
require
is a very useful command. It can be used to load a Titanium native compiled module such as the one from the Appcelerator marketplace, http://www.appcelerator.com/marketplace, or it can load a commonJS source file. Both uses of require
correspond to good Titanium design. Let's examine both uses.
Require – loading a marketplace module
The Appcelerator marketplace exists to provide modules for times when you either need functionality that cannot be coded using the Titanium API, or for saving you time by giving you functionality that would take valuable time to code yourself. There are some great modules in the marketplace, some of which are free. We will take advantage of one of the free offerings in the next example when we add a bit of color to the app.