index.js
function parseBody(bodyString, model, options, cb) {

  var result;
  var dom;

  /**
   * Load the HTML and parse it with cheerio to create a DOM
   */

  try {
    dom = cheerio.load(bodyString, options.cheerioOptions);
  } catch (err) {
    err.bodyString = bodyString;
    return cb(err);
  }

  result = getItem(dom, model, options.itemOptions);

  if (result instanceof Error) {
    result.bodyString = bodyString;
    return cb(result);
  }

  return cb(null, result);

}
function parseBody(bodyString, model, options, cb) {

  var result;
  var dom;

  /**
   * Load the HTML and parse it with cheerio to create a DOM
   */

  try {
    dom = cheerio.load(bodyString, options.cheerioOptions);
  } catch (err) {
    err.bodyString = bodyString;
    return cb(err);
  }

  result = getItem(dom, model, options.itemOptions);

  if (result instanceof Error) {
    result.bodyString = bodyString;
    return cb(result);
  }

  return cb(null, result);

}
function parseBody ( bodyString , model , options , cb ) { var result ; var dom ; /**
   * Load the HTML and parse it with cheerio to create a DOM
   */ try { dom = cheerio . load ( bodyString , options . cheerioOptions ) ; } catch ( err ) { err . bodyString = bodyString ; return cb ( err ) ; } result = getItem ( dom , model , options . itemOptions ) ; if ( result instanceof Error ) { result . bodyString = bodyString ; return cb ( result ) ; } return cb ( null , result ) ; }
Parse the HTML in search of each item in `model`
@param  {string}           bodyString  HTML content
@param  {Object|string}    model       Data model or string
@param  {Object}           options     Item defaults
@param  {Function}         cb          Callback
@return {null}
Parse the HTML in search of each item in model