//generate a dom var handler = new (require("domhandler"))(); (new (require("htmlparser2").Parser)(handler)).parseComplete( Array(21).join(" text ") ); var dom = handler.dom; exports.dir = "/DomUtils/"; exports.test = function(test, cb){ cb(null, test.getElements(dom)); cb(null, test.getByFunction(dom)); };