index.js
//Function to prompt user and collect answers using inquirer
Function to prompt user and collect answers using inquirer
Function to prompt user and collect answers using inquirer
function promptUser() {
    return inquirer.prompt([{
        type: "input",
        message: "Enter your GitHub username",
        name: "username"
    },
    {
        type: "list",
        message: "Enter your favorite color",
        name: "color",
        choices: [
            "red",
            "blue",
            "purple",
            "yellow",
            "white",
            "orange",
            "green"
        ]
    }
    ])
        .then(function ({ username, color }) {
            const queryUrl = `https://api.github.com/users/${username}?per_page=100`;
            numbOfRepoStar(username)
            return axios
                .get(queryUrl)
                .then(resp => {
                    const data = resp
                    return {
                        githubData: resp,
                        nameColor: color,
                    }
                })
        });
}
function promptUser ( ) { return inquirer . prompt ( [ { type : "input" , message : "Enter your GitHub username" , name : "username" } , { type : "list" , message : "Enter your favorite color" , name : "color" , choices : [ "red" , "blue" , "purple" , "yellow" , "white" , "orange" , "green" ] } ] ) . then ( function ( { username , color } ) { const queryUrl = ` ${ username } ` ; numbOfRepoStar ( username ) return axios . get ( queryUrl ) . then ( resp => { const data = resp return { githubData : resp , nameColor : color , } } ) } ) ; }
Function to prompt user and collect answers using inquirer
Function to prompt user and collect answers using inquirer
//return color and user GitHub login name