// try different search responseGroups to find the one with the info we want
var CrawlQueue = require("../lib/crawl_queue");
var log = require("../lib/log")

var responseGroups = [
	"Small",
	"Medium",
	"Large",
	"OfferFull",
	"OfferListings",
	"Offers",
	"OfferSummary",
	"PromotionSummary",
	"VariationOffers"
];

var main = function() {
	var maxDepth = process.argv[2] || 2;
	
	var rootAsin = 'B014V4DXMW'; //starting ASIN
	var crawler = new CrawlQueue({maxCrawlDepth: maxDepth});
	var searchTerm = rootAsin;
	responseGroups.forEach(function(responseGroup) {
		crawler.keywordSearch(searchTerm, responseGroup,function(err, result) {
			log.info(responseGroup, "RESPONSE GROUP");
			if (err) {
				log.error(err, "Error in scripts/search.js#main()");
				log.error(err.stack, "stack");
			}
			try {
				delete result.OperationRequest;
			} catch (e) {
				log.warn({}, "result.OperationRequest does not exist");
			}
			log.info(result, "search result: ");
		});
	});
};

main();

@@ -371,17 +371,16 @@
 %5D %7C%7C 2;%0A
-%09
 %0A%09var ro
@@ -504,16 +504,35 @@
 otAsin;%0A
+%09var searched = 0;%0A
 %09respons
@@ -971,16 +971,100 @@
 lt: %22);%0A
+%09%09%09searched++;%0A%09%09%09if (searched == responseGroups.length) %7B%0A%09%09%09%09process.exit();%0A%09%09%09%7D%0A
 %09%09%7D);%0A%09%7D

Make sure script exits