function html(url) {
  return new Promise((resolve, reject) => {
    let filename = crypto.createHash('md5').update(url).digest('hex');
    let output = `${resolveTempFilesPath(filename)}.html`;

    rp(url)
      .then((data) => {
        let htmlCode = data.toString();
        fs.writeFile(output, htmlCode, (err) => {
          if (err) {
            reject(err);
            return;
          }
          resolve({
            filePath: output,
            htmlCode: htmlCode
          });
        });
      })
      .catch((err) => {
        reject(err);
      });
  });
}
/**
 * Get HTML code from an url and saves it in the temp folder
 *
 * @async
 * @param {string} url Documents url.
 * @returns {Promise<object>} Promise object with the html code 
 */
Get HTML code from an url and saves it in the temp folder
@async
@param {string} url Documents url.
@returns {Promise} Promise object with the html code
Get HTML code from an url and saves it in the temp folder @async @param { string } url Documents url . @returns { Promise } Promise object with the html code
function html(url) {
  return new Promise((resolve, reject) => {
    let filename = crypto.createHash('md5').update(url).digest('hex');
    let output = `${resolveTempFilesPath(filename)}.html`;
    rp(url)
      .then((data) => {
        let htmlCode = data.toString();
        fs.writeFile(output, htmlCode, (err) => {
          if (err) {
            reject(err);
            return;
          }
          resolve({
            filePath: output,
            htmlCode: htmlCode
          });
        });
      })
      .catch((err) => {
        reject(err);
      });
  });
}
function html ( url ) { return new Promise ( ( resolve , reject ) => { let filename = crypto . createHash ( 'md5' ) . update ( url ) . digest ( 'hex' ) ; let output = ` ${ resolveTempFilesPath ( filename ) } ` ; rp ( url ) . then ( ( data ) => { let htmlCode = data . toString ( ) ; fs . writeFile ( output , htmlCode , ( err ) => { if ( err ) { reject ( err ) ; return ; } resolve ( { filePath : output , htmlCode : htmlCode } ) ; } ) ; } ) . catch ( ( err ) => { reject ( err ) ; } ) ; } ) ; }
Get HTML code from an url and saves it in the temp folder
 @async
 @param {string} url Documents url.
Get HTML code from an url and saves it in the temp folder @async @param { string } url Documents url .