const getdata = (async function() {
return {
cities: await new Promise((res, rej) => {
connection.query('SELECT * FROM posts', (err, result) => {
if (err) throw err
res(result)
})
}),
posts: await new Promise((res, rej) => {
connection.query('SELECT * FROM posts', (err, result) => {
if (err) throw err
res(result)
})
})
}
})()
console.log(getdata);
Promise { <pending> }