src/index.js
function fetchGitHub(url) {
  return fetch(url).then(res => {
    if (res.status === STATUS_NOT_FOUND) {
      throw new Error('USER_NOT_FOUND');
    } else if (res.status !== STATUS_OK) {
      throw new Error('CANNOT_FETCH_DATA');
    }
    return res.text();
  });
}
function fetchGitHub(url) {
  return fetch(url).then(res => {
    if (res.status === STATUS_NOT_FOUND) {
      throw new Error('USER_NOT_FOUND');
    } else if (res.status !== STATUS_OK) {
      throw new Error('CANNOT_FETCH_DATA');
    }
    return res.text();
  });
}
function fetchGitHub ( url ) { return fetch ( url ) . then ( res => { if ( res . status === STATUS_NOT_FOUND ) { throw new Error ( 'USER_NOT_FOUND' ) ; } else if ( res . status !== STATUS_OK ) { throw new Error ( 'CANNOT_FETCH_DATA' ) ; } return res . text ( ) ; } ) ; }
Fetch HTML from GitHub

@param {string} url - URL
@return {Promise<string, Error>}
Fetch HTML from GitHub