function listItems() {
    connection.query("SELECT * FROM products;", function (err, results) {
        if (err) throw err;
        console.log("***********************************INVENTORY******************************************");
        for (let i = 0; i < results.length; i++) {
            console.log("_________________________________________________________________________________________");
            console.log("ID#:", results[i].item_id, "\n", "\tproduct name:", results[i].product_name, "\t", "price:",
                results[i].price, "\t", "quantity:", results[i].stock_quantity);
        }
        console.log("");
        console.log("*********************************************************************************************");
        inquirer.prompt([{
            type: "list",
            name: "userInput",
            message: "Choose from available choices below:",
            choices: ["<--Back"]
        }]).then(function (answer) {
            if (answer.userInput) {
                prompter();
            }
        })
    });
}
//If the items are in stock then call math function.  
If the items are in stock then call math function.
If the items are in stock then call math function .
function listItems() {
    connection.query("SELECT * FROM products;", function (err, results) {
        if (err) throw err;
        console.log("***********************************INVENTORY******************************************");
        for (let i = 0; i < results.length; i++) {
            console.log("_________________________________________________________________________________________");
            console.log("ID#:", results[i].item_id, "\n", "\tproduct name:", results[i].product_name, "\t", "price:",
                results[i].price, "\t", "quantity:", results[i].stock_quantity);
        }
        console.log("");
        console.log("*********************************************************************************************");
        inquirer.prompt([{
            type: "list",
            name: "userInput",
            message: "Choose from available choices below:",
            choices: ["<--Back"]
        }]).then(function (answer) {
            if (answer.userInput) {
                prompter();
            }
        })
    });
}
function listItems ( ) { connection . query ( "SELECT * FROM products;" , function ( err , results ) { if ( err ) throw err ; console . log ( "***********************************INVENTORY******************************************" ) ; for ( let i = 0 ; i < results . length ; i ++ ) { console . log ( "_________________________________________________________________________________________" ) ; console . log ( "ID#:" , results [ i ] . item_id , "\n" , "\tproduct name:" , results [ i ] . product_name , "\t" , "price:" , results [ i ] . price , "\t" , "quantity:" , results [ i ] . stock_quantity ) ; } console . log ( "" ) ; console . log ( "*********************************************************************************************" ) ; inquirer . prompt ( [ { type : "list" , name : "userInput" , message : "Choose from available choices below:" , choices : [ "<--Back" ] } ] ) . then ( function ( answer ) { if ( answer . userInput ) { prompter ( ) ; } } ) } ) ; }
If the items are in stock then call math function.
If the items are in stock then call math function .