lib/include.js
function setParents () {
		var q = async.queue(processFile, 1)
		q.drain = function () { self.emit('drain') }

		// Process files with no dependency first
		self.nodeps.forEach( q.push )

		function processFile (item, cb) {
			debug('dep:', item.id)
			// Add files with no dependency left to be processed
			self.deps
				.forEach(function (file) {
					if ( file.count > 0 && file.deps.indexOf(item.id) >= 0 ) {
						item.parents.push(file.id)
						file.count--
						debug('file %s -> %d', file.id, file.count)
						if (file.count === 0) q.push(file)
					}
				})
			cb()
		}
	}
function setParents () {
		var q = async.queue(processFile, 1)
		q.drain = function () { self.emit('drain') }

		// Process files with no dependency first
		self.nodeps.forEach( q.push )

		function processFile (item, cb) {
			debug('dep:', item.id)
			// Add files with no dependency left to be processed
			self.deps
				.forEach(function (file) {
					if ( file.count > 0 && file.deps.indexOf(item.id) >= 0 ) {
						item.parents.push(file.id)
						file.count--
						debug('file %s -> %d', file.id, file.count)
						if (file.count === 0) q.push(file)
					}
				})
			cb()
		}
	}
function setParents ( ) { var q = async . queue ( processFile , 1 ) q . drain = function ( ) { self . emit ( 'drain' ) } // Process files with no dependency first self . nodeps . forEach ( q . push ) function processFile ( item , cb ) { debug ( 'dep:' , item . id ) // Add files with no dependency left to be processed self . deps . forEach ( function ( file ) { if ( file . count > 0 && file . deps . indexOf ( item . id ) >= 0 ) { item . parents . push ( file . id ) file . count -- debug ( 'file %s -> %d' , file . id , file . count ) if ( file . count === 0 ) q . push ( file ) } } ) cb ( ) } }
Once all files are loaded, set their parents
Once all files are loaded set their parents