lib/parser.js
function makeModule(index) {

		var stored, src, srcPath, relpath;

		// Prepare module
		var module  = new Module({
			 uid:    index
			,req:    []
			,path:   index
			,relpath: null
			,isNodeModule: false
			,isAsyncModule: arequirePath === index
			,arequirePath:  arequirePath
			,index:  index
		});

		if(~module.path.indexOf('/node_modules/')) module.isNodeModule = true;

		relpath = path.relative(process.cwd(), module.path);
		relpath = !/^\./.test(relpath) ? './' + relpath : relpath;
		module.relpath = relpath;

		debug('makeModule for %s', relpath);

		// Check for stored version of this path
		stored = _.find(modules, function(p) {
			return module.path === p.path;
		});
		if(stored) {
			debug('allready stored : return (absolute path match)');
			return stored;
		}

		// Read source
		src           = fs.readFileSync(module.path, 'utf8');
		module.mtime  = fs.statSync(module.path).mtime;
		module.uid    = getUID({src: src, path:module.path, options: options});

		// Check for stored version with same uid
		stored = _.find(modules, function(p) {
			return module.uid  === p.uid;
		});
		if(stored) {
			debug('allready stored : return (md5 hash match)');
			return stored;
		}

		// Save module
		modules.push(module);

		// Do not parse ?
		module.notparsed = _.find(noparse, function(np) {
			if(np instanceof RegExp) {
				return np.test(module.path);
			} else if ('string'   == typeof np) {
				return minimatch(module.path, np);
			} else if ('function' == typeof np) {
				return np(module.path, module);
			} else {
				return false;
			}
		});

		// Parse
		if(module.notparsed) {
			debug('  no parse');
		} else {
			debug('  run parse');
			src = parse(src, module, makeModule, options);
		}

		// Store the module source :
		module.source = src;


		// Return the module object

		debug('end %s', relpath);
		return module;
	}
function makeModule(index) {

		var stored, src, srcPath, relpath;

		// Prepare module
		var module  = new Module({
			 uid:    index
			,req:    []
			,path:   index
			,relpath: null
			,isNodeModule: false
			,isAsyncModule: arequirePath === index
			,arequirePath:  arequirePath
			,index:  index
		});

		if(~module.path.indexOf('/node_modules/')) module.isNodeModule = true;

		relpath = path.relative(process.cwd(), module.path);
		relpath = !/^\./.test(relpath) ? './' + relpath : relpath;
		module.relpath = relpath;

		debug('makeModule for %s', relpath);

		// Check for stored version of this path
		stored = _.find(modules, function(p) {
			return module.path === p.path;
		});
		if(stored) {
			debug('allready stored : return (absolute path match)');
			return stored;
		}

		// Read source
		src           = fs.readFileSync(module.path, 'utf8');
		module.mtime  = fs.statSync(module.path).mtime;
		module.uid    = getUID({src: src, path:module.path, options: options});

		// Check for stored version with same uid
		stored = _.find(modules, function(p) {
			return module.uid  === p.uid;
		});
		if(stored) {
			debug('allready stored : return (md5 hash match)');
			return stored;
		}

		// Save module
		modules.push(module);

		// Do not parse ?
		module.notparsed = _.find(noparse, function(np) {
			if(np instanceof RegExp) {
				return np.test(module.path);
			} else if ('string'   == typeof np) {
				return minimatch(module.path, np);
			} else if ('function' == typeof np) {
				return np(module.path, module);
			} else {
				return false;
			}
		});

		// Parse
		if(module.notparsed) {
			debug('  no parse');
		} else {
			debug('  run parse');
			src = parse(src, module, makeModule, options);
		}

		// Store the module source :
		module.source = src;


		// Return the module object

		debug('end %s', relpath);
		return module;
	}
function makeModule ( index ) { var stored , src , srcPath , relpath ; // Prepare module var module = new Module ( { uid : index , req : [ ] , path : index , relpath : null , isNodeModule : false , isAsyncModule : arequirePath === index , arequirePath : arequirePath , index : index } ) ; if ( ~ module . path . indexOf ( '/node_modules/' ) ) module . isNodeModule = true ; relpath = path . relative ( process . cwd ( ) , module . path ) ; relpath = ! / ^\. / . test ( relpath ) ? './' + relpath : relpath ; module . relpath = relpath ; debug ( 'makeModule for %s' , relpath ) ; // Check for stored version of this path stored = _ . find ( modules , function ( p ) { return module . path === p . path ; } ) ; if ( stored ) { debug ( 'allready stored : return (absolute path match)' ) ; return stored ; } // Read source src = fs . readFileSync ( module . path , 'utf8' ) ; module . mtime = fs . statSync ( module . path ) . mtime ; module . uid = getUID ( { src : src , path : module . path , options : options } ) ; // Check for stored version with same uid stored = _ . find ( modules , function ( p ) { return module . uid === p . uid ; } ) ; if ( stored ) { debug ( 'allready stored : return (md5 hash match)' ) ; return stored ; } // Save module modules . push ( module ) ; // Do not parse ? module . notparsed = _ . find ( noparse , function ( np ) { if ( np instanceof RegExp ) { return np . test ( module . path ) ; } else if ( 'string' == typeof np ) { return minimatch ( module . path , np ) ; } else if ( 'function' == typeof np ) { return np ( module . path , module ) ; } else { return false ; } } ) ; // Parse if ( module . notparsed ) { debug ( '  no parse' ) ; } else { debug ( '  run parse' ) ; src = parse ( src , module , makeModule , options ) ; } // Store the module source : module . source = src ; // Return the module object debug ( 'end %s' , relpath ) ; return module ; }
Create a module object for the index receives an absolute filepath to parse, and return a new Module object
Create a module object for the index receives an absolute filepath to parse and return a new Module object