function dataConverter(data) {
    return new Promise(resolve => {
        const origData = data;
        try {
            let patterns = new Set();
            // CASE: Converting require("./foo")(app) to app.use(require("./foo"))
            if (!data) {
                return resolve({
                    data,
                    patterns: []
                });
            }

            let founds = data.split(new RegExp('(require\\s*\\n*\\t*\\(.*\\)\\s*\\n*\\t*\\(\\s*\\n*\\t*.*\\s*\\n*\\t*\\))'));
            for (let idx = 0; idx < founds.length; ++idx) {
                let req = founds[idx];
                if (req.split(new RegExp('^require')).length == 1) continue;

                if (founds[idx - 1] && founds[idx - 1].trim().slice(-1)[0] == '=') {
                    // avoiding cases, such as: const foo = require(...)()
                    continue;
                }

                req = req.split(new RegExp('require\\s*\\n*\\t*\\(|\\)\\s*\\n*\\t*\\('));
                if (req && (req.length < 2 || !req[1].includes('./') || !req[2])) {
                    continue;
                }

                req[2] = req[2].split(')')[0].trim();
                req[2] = req[2].split(',')[0]; // TODO: verify which possition in req[2][0] is a route
                patterns.add(req[2]);

                let converted = `${req[2]}.use(require(${req[1]}))`;
                data = data.replace(founds[idx], converted); // TODO: use replaceAll() ?
            }
            return resolve({
                data,
                patterns: [...patterns]
            });
        } catch (err) {
            return resolve({
                data: origData,
                patterns: []
            });
        }
    });
}
Convert statements such as: "require('./path')(foo)" in "foo.use(require('./path'))"
Useful, because the statement "foo.use(require('./path'))" is already handled successfully.
@param {string} data file content