After trying out a few ES6+ features, I decided to follow a tutorial and made a vanilla JS fetching Github user profile by using Async/await and Fetch API features.

const fetchUsers = async (user) => {
  const api_call = await 
// Joined string and variables by Template Literal 
fetch(`https://api.github.com/users/${user}?client_id=${client_id}&client_secret=${client_secret}`);
  const data = await api_call.json();
  return { data }
}

Dev env:
1. SASS
2. Vanilla JS
Demo: https://dist-lqxmlrwupp.now.sh/

Screenshot

References:

  • https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals
  • https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await