How does Sequels load all models at once?

class Models {

    async setModels(app){

        const sequelize = require("sequelize")
        const files = await this.readModels()

        global.Models = {}
        global.Models._Op = sequelize.Op

        app.context.Models = {}
        app.context.Models._Op = sequelize.Op

        files.forEach((value, key, arr) => {

            global.Models[key] = utils.db().import( value )
            app.context.Models[key] = utils.db().import( value )

        })

    }

    async readModels(){

        const fs = require("fs")
        const modelsPath = __dirname + "/db/"

        return new Promise( async (resolve, reject)=>{

            await fs.readdir(
                modelsPath,
                (err, data) => {

                    if (err){
                        resolve(err)
                        return
                    }

                    const map = new Map()

                    for ( let i in data ){

                        let name = data[i].match(/^[0-9A-Za-z]*/gi)
                        map.set(
                            name,
                            modelsPath + data[i]
                        )

                    }

                    resolve(map)

                }
            )

        })

    }

}

module.exports = Models

how can I load all the models at once instead of as complicated as I"m writing now?

Feb.05,2022
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e452ca-44b06.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e452ca-44b06.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?