bin/hitchy-pm.js
function processSimple( names, current, stopAt, collector, done ) {
	const name = names[current];

	File.stat( Path.join( "node_modules", name, "hitchy.json" ), ( error, stat ) => {
		if ( error ) {
			if ( error.code === "ENOENT" ) {
				collector.push( name );
			} else {
				done( error );
				return;
			}
		} else if ( stat.isFile() ) {
			if ( !quiet ) {
				console.error( `${name} ... found` );
			}
		} else {
			done( new Error( `dependency ${name}: not a folder` ) );
			return;
		}

		if ( ++current < stopAt ) {
			processSimple( names, current, stopAt, collector, done );
		} else {
			done( null, collector );
		}
	} );
}
function processSimple( names, current, stopAt, collector, done ) {
	const name = names[current];

	File.stat( Path.join( "node_modules", name, "hitchy.json" ), ( error, stat ) => {
		if ( error ) {
			if ( error.code === "ENOENT" ) {
				collector.push( name );
			} else {
				done( error );
				return;
			}
		} else if ( stat.isFile() ) {
			if ( !quiet ) {
				console.error( `${name} ... found` );
			}
		} else {
			done( new Error( `dependency ${name}: not a folder` ) );
			return;
		}

		if ( ++current < stopAt ) {
			processSimple( names, current, stopAt, collector, done );
		} else {
			done( null, collector );
		}
	} );
}
function processSimple ( names , current , stopAt , collector , done ) { const name = names [ current ] ; File . stat ( Path . join ( "node_modules" , name , "hitchy.json" ) , ( error , stat ) => { if ( error ) { if ( error . code === "ENOENT" ) { collector . push ( name ) ; } else { done ( error ) ; return ; } } else if ( stat . isFile ( ) ) { if ( ! quiet ) { console . error ( ` ${ name } ` ) ; } } else { done ( new Error ( ` ${ name } ` ) ) ; return ; } if ( ++ current < stopAt ) { processSimple ( names , current , stopAt , collector , done ) ; } else { done ( null , collector ) ; } } ) ; }
Successively tests provided names of dependencies for matching existing
folder in local sub-folder `node_modules` each containing file hitchy.json.

@param {string[]} names list of dependency names to be tested
@param {int} current index of next item in provided list to be processed
@param {int} stopAt index to stop at
@param {string[]} collector lists names considered missing related folder in local `node_modules`
@param {function(?Error)} done callback invoked on error or when done
Successively tests provided names of dependencies for matching existing folder in local sub - folder node_modules each containing file hitchy . json .