Forging Titanium Episode 11: Titanium & Underscore.js

Abstract cloud computing service background. Technology and data concept. 3D Rendering

Editor’s note: This and future episodes of Forging Titanium are available here.

As Titanium developers, we are constantly looking for ways to not only increase our ability as mobile developers, but as Javascript developers as well. Wrapping your head around powerful utility libraries like Underscore.js and using them in your own code is one important step in that direction.

In this week’s episode of “Forging Titanium” will be taking a look at how we can use Underscore.js to quickly handle one of the most common tasks in any app: data normalization. We’ll see how our code can be made more concise and expressive through the use of Underscore’s many useful functions. In the end we’ll have a simple, cross platform, table-driven app whose code is easy to read and maintain.

Episode Resources:


  1. I am unable to get this imported in my project. Is there something special I have to do / that I’m missing?

    Here is some relevant output:

    from the command line:

    leos-MacBook-Pro:../eevz $>ls Resources/*.js
    Resources/app.js Resources/underscore.js
    leos-MacBook-Pro:../eevz $>head -n3 Resources/app.js
    var _ = require(‘underscore’)._;

    from the studio console:
    [INFO] One moment, building …
    [INFO] Titanium SDK version: (12/22/11 13:09 fbdc96f)
    [INFO] iPhone Device family: iphone
    [INFO] iPhone SDK version: 5.0
    [INFO] iPhone simulated device: iphone
    [INFO] Launching application in Simulator
    [INFO] Launched application in Simulator (5.15 seconds)
    [INFO] Found 5.0 patch installed
    [INFO] Application started
    [INFO] eevz/1.0 (
    [ERROR] Script Error = Couldn’t find module: underscore.

Comments are closed.