lib/bundleLocator.js
function BundleLocator(options) {
    this._options = options || {};
    if (this._options.applicationDirectory) {
        this._options.applicationDirectory = libpath.resolve(process.cwd(), this._options.applicationDirectory);
    } else {
        this._options.applicationDirectory = process.cwd();
    }
    this._options.maxPackageDepth = this._options.maxPackageDepth || DEFAULT_MAX_PACKAGES_DEPTH;
    this._options.exclude = this._options.exclude || [];

    this._cacheRules = {};      // rulename + package directory: rules

    this._bundles = {};
    this._bundlePaths = {};     // path: name
    this._bundleUpdates = {};   // name: object describing why the update happened
}
function BundleLocator(options) {
    this._options = options || {};
    if (this._options.applicationDirectory) {
        this._options.applicationDirectory = libpath.resolve(process.cwd(), this._options.applicationDirectory);
    } else {
        this._options.applicationDirectory = process.cwd();
    }
    this._options.maxPackageDepth = this._options.maxPackageDepth || DEFAULT_MAX_PACKAGES_DEPTH;
    this._options.exclude = this._options.exclude || [];

    this._cacheRules = {};      // rulename + package directory: rules

    this._bundles = {};
    this._bundlePaths = {};     // path: name
    this._bundleUpdates = {};   // name: object describing why the update happened
}
The Locator walks the filesystem and gives semantic meaning to
files in the application.
@module Locator
 
@class Locator
@constructor
@param {object} [options] Options for how the configuration files are located.
@param {string} [options.applicationDirectory] Where the application will be found.
If not given it defaults to the current working directory.
@param {[string]} [options.exclude] folder names that should not be analyzed
@param {integer} options.maxPackageDepth Maximum depth in `node_modules/` to walk.
Defaults to 9999.
@param {function} options.rulesetFn Function hook to compute rules per bundle dynamically.
This hook allow to analyze the pkg, and produce the proper rules when needed.

@example (note constructor "BundleLocator" is exported as "Locator")
var locOpts = {
applicationDirectory: __dirname,
exclude: ['build'],
maxPackageDepth: 5
},
locator = new Locator(locOpts);