npm install empath -g
$ empath backbone # give it the path of the directory Searching for main in backbone has backbone/bower.json? yes No main found in backbone/bower.json has backbone/component.json? no has backbone/package.json? yes Main found in backbone/package.json: backbone.js Supports AMD? no Supports CommonJS? yes dependencies: underscore exports a object Globals variables exported Backbone
Ah, okay. Empath tells you that the main file to include is:
backbone.js at the root of the directory and that it does not support the AMD module format but does support the CommonJS format and depends on underscore. Or if you don't use a module system and just want to include it in a script tag, then it exports
Backbone as a global variable.
On the issue of module format, there are generally three camps:
- We don't need a module system, just add globals
- Jam - A registry and package manager with a easy workflow. AMD-based.
- Bower - a new registry by Twitter. Format agnostic but does nothing for workflow.
- Component - the only front-end module registry using CommonJS. Requires a build step.
- Volo - Another AMD-based registry with workflow and project scaffolding.
For more information on module registries, take a look a this article by wilmoore.