Help with my code

I have written a script in Node JS to scan a barcode and get the album information from a database and then play the album using volumio. However I can only get the script to run once, I want it on a loop so I can continuously run it. Can anyone help me?

const prompt = require('prompt-sync')();
const mariadb = require('mariadb');


const pool = mariadb.createPool({
  host: '',
  user: '',
  password: '',
  database: ''
});

function getbarcode() {
 const name = prompt('');
 /*return(`${name}`);*/

queryDatabase(`${name}`)
 
}

async function queryDatabase(name) {
  let conn;
 
  try {
    conn = await pool.getConnection();
    const rows = await conn.query("SELECT band, album FROM tbl_music WHERE b_code = '" + name + "'");
    
    const myband = (rows[0].band);
    const myalbum =(rows[0].album);

    console.log(myband);
    console.log(myalbum);
  
    const io = require('socket.io-client2')
   var volumioSocket = io.connect('http://ip address', {reconnect: true});

   volumioSocket.on('connect', function() {
     console.log('Connected to Volumio Socket.IO server');
   });
   const albumURI = 'mnt/NAS/music/'+ myband + '/'+ myalbum ;

   volumioSocket.emit('replaceAndPlay', {'uri': albumURI});
   getbarcode()
  } catch (err) {
    throw err;
  } finally {
    if (conn) return conn.end();
  }
}

  

getbarcode()

You can do something like:

const {execSync} = require('child_process');

while(true) { 
     getbarcode()
     execSync('sleep 10');
}