async function getImportedFiles(data, localRelativePath = '') {
    let importedFiles = [];
    let knownFunctions = ['express', 'express-async-handler'];
    try {
        const aliasRegex = /\s*\*\s*as\s+|\s*as\s+/;
        let importeds = data.split(new RegExp(`import`, 'i'));
        let requireds = data.replaceAll('\n', ' ').split(new RegExp(`\\s*\\t*const\\s+|\\s*\\t*var\\s+|\\s*\\t*let\\s+`, 'i'));
        requireds = requireds.filter(e => e.split(new RegExp(`=\\s*\\t*require\\s*\\t*\\(`, 'i')).length > 1);

        // Such as: import foo, { Foo } from './foo'
        if (importeds && importeds.length > 1) {
            importeds.shift();

            // TODO: refactor this. Pass to outside
            let tsPaths = [];
            let tsBaseUrl = null;
            let tsconfig = await utils.getFileContent(process.cwd() + '/tsconfig.json');
            let tsConfigPath = localRelativePath.replace('./', '/');
            let tsRelativePath = null;

            if (!tsconfig && tsConfigPath && tsConfigPath.includes('/')) {
                tsConfigPath = tsConfigPath.split('/');
                for (let idx = tsConfigPath.length; idx >= 2; idx--) {
                    let path = tsConfigPath.slice(0, idx).join('/');
                    tsconfig = await utils.getFileContent(process.cwd() + path + '/tsconfig.json');
                    if (tsconfig) {
                        tsRelativePath = '.' + path;
                        break;
                    }
                }
            }
            if (tsconfig) {
                tsconfig = await handleData.removeComments(tsconfig);
                tsconfig = JSON5.parse(tsconfig); // Allow trailing commas
                tsPaths = tsconfig.compilerOptions && tsconfig.compilerOptions.paths && typeof tsconfig.compilerOptions.paths === 'object' ? Object.entries(tsconfig.compilerOptions.paths) : [];
                tsBaseUrl = tsconfig.compilerOptions && tsconfig.compilerOptions.baseUrl && typeof tsconfig.compilerOptions.baseUrl === 'string' ? tsconfig.compilerOptions.baseUrl : null;
                let rootDir = tsconfig.compilerOptions && tsconfig.compilerOptions.rootDir ? tsconfig.compilerOptions.rootDir : '';
                if (tsRelativePath) {
                    tsRelativePath += rootDir.replace('.', '');
                }
            }

            // Verify if .eslintrc
            let eslintConfig = await utils.getFileContent(process.cwd() + '/.eslintrc');
            if (eslintConfig) {
                eslintConfig = await handleData.removeComments(eslintConfig);
                eslintConfig = JSON5.parse(eslintConfig); // Allow trailing commas
                if (eslintConfig.settings && eslintConfig.settings['import/resolver'] && eslintConfig.settings['import/resolver']['babel-plugin-root-import']) {
                    let rootPath = eslintConfig.settings['import/resolver']['babel-plugin-root-import'];
                    let rootPathPrefix = rootPath.rootPathPrefix;
                    let rootPathSuffix = rootPath.rootPathSuffix;
                    if (rootPathPrefix && rootPathSuffix) {
                        tsPaths.push([rootPathPrefix, [rootPathSuffix]]);
                    }
                }
            }

            for (let index = 0; index < importeds.length; ++index) {
                let imp = importeds[index];
                let obj = {
                    varFileName: null,
                    fileName: null,
                    exports: []
                };
                let varFileName = imp.split(new RegExp(`from`, 'i'))[0].trim();

                if (varFileName) {
                    const origVarFileName = varFileName;
                    try {
                        let instancesRegex = `\\s*\\n*\\t*\\=\\s*\\n*\\t*new\\s+${varFileName}\\s*\\n*\\t*\\(`;
                        let modData = data.replaceAll(new RegExp('\\s*\\n*\\t*:\\s*\\n*\\t*'), ':');
                        let instances = modData.split(new RegExp(instancesRegex));
                        if (instances.length > 1) {
                            instances.pop();
                            let newVarFileName = '{ ';
                            instances
                                .filter(e => e)
                                .forEach(inst => {
                                    let instance = inst.split(' ').slice(-1)[0];
                                    if (instance.includes(':')) {
                                        instance = instance.split(':')[0];
                                    }
                                    newVarFileName += instance + ', ';
                                });
                            newVarFileName += varFileName + ' }';
                            varFileName = newVarFileName;
                        }
                    } catch (err) {
                        varFileName = origVarFileName;
                    }

                    try {
                        let instancesRegex = `\\s*\\n*\\t*\\}\\s*\\n*\\t*\\=\\s*${origVarFileName}\\;?\\s+`;
                        let instances = data.replaceAll('\n', ' ').split(new RegExp(instancesRegex));
                        if (instances.length > 1) {
                            instances.pop();
                            let newVarFileName = '{ ';
                            instances
                                .filter(e => e)
                                .forEach(inst => {
                                    let vars = inst.split('{').slice(-1)[0];
                                    newVarFileName += vars + ', ';
                                });
                            newVarFileName += varFileName + ' }';
                            varFileName = newVarFileName;
                        }

                        instancesRegex = `\\s*\\n*\\t*\\s*\\n*\\t*\\=\\s*${origVarFileName}\\;?\\s+`;
                        instances = data.replaceAll('\n', ' ').split(new RegExp(instancesRegex));
                        if (instances.length > 1) {
                            instances.pop();
                            let newVarFileName = '{ ';
                            instances
                                .filter(e => e)
                                .forEach(inst => {
                                    if (inst.trim().slice(-1)[0] == '}') {
                                        return;
                                    }
                                    let varsName = inst.split(' ').slice(-1)[0];
                                    newVarFileName += varsName + ', ';
                                });
                            newVarFileName += varFileName + ' }';
                            varFileName = newVarFileName;
                            varFileName = varFileName.replaceAll(' ', '').replaceAll(',{', ',').replaceAll('{{', '{').replaceAll('}}', '}');
                        }
                    } catch (err) {
                        varFileName = origVarFileName;
                    }
                }

                if (varFileName.includes('{')) {
                    if (varFileName.split(new RegExp(',\\s*\\n*\\t*{')).length > 1) {
                        // such as: import foo, { Foo } from './foo'
                        obj.varFileName = varFileName.split('{')[0].replaceAll(',', '').trim();
                    }
                    varFileName = varFileName.replaceAll('\n', '');
                    varFileName
                        .split('{')[1]
                        .split(',')
                        .filter(e => e)
                        .forEach(exp => {
                            exp = exp.replaceAll('{', '').replaceAll('}', '').replaceAll(',', '').trim();
                            if (exp == '') {
                                return;
                            }

                            if (aliasRegex.test(exp)) {
                                // alias
                                obj.exports.push({
                                    varName: exp.split(aliasRegex)[0],
                                    varAlias: exp.split(aliasRegex)[1],
                                    path: null
                                });
                            } else {
                                obj.exports.push({
                                    varName: exp,
                                    varAlias: null,
                                    path: null
                                });
                            }
                        });
                } else {
                    if (aliasRegex.test(varFileName)) {
                        obj.varFileName = varFileName.split(aliasRegex)[1];
                    } else {
                        obj.varFileName = varFileName;
                    }
                }

                // REFACTOR
                let fileName = imp.split(new RegExp(';|\\n'))[0].trim();
                fileName && fileName.split(new RegExp(' from |\\}\\s*from\\s*\\"?\\\'?\\`?', 'i')).length > 1 ? (fileName = fileName.split(new RegExp(' from |\\}\\s*from\\s*\\"?\\\'?\\`?', 'i'))[1].trim()) : imp.split(new RegExp(' from |\\}\\s*from\\s*\\"?\\\'?\\`?', 'i')).length > 1 ? (fileName = imp.split(new RegExp(' from |\\}\\s*from\\s*\\"?\\\'?\\`?', 'i'))[1].trim()) : fileName;

                fileName = fileName.split(new RegExp('\\n|\\;'))[0].trim();
                fileName = fileName.replaceAll("'", '').replaceAll('"', '').replaceAll('`', '').replaceAll(' ', '').replaceAll(';', '').replaceAll('\n', '');
                fileName = fileName.replaceAll('//', '/').replaceAll('//', '/').replaceAll('\\\\', '\\').replaceAll('\\\\', '\\');

                let pathPattern = fileName.split('/').slice(0, -1).join('/');
                let found = tsPaths.find(p => p[0] && p[0].split('/*')[0] == pathPattern);
                let relativePath = localRelativePath;
                if (!found && pathPattern && pathPattern.includes('/')) {
                    let tsPathPattern = pathPattern.split('/');
                    for (let idx = tsPathPattern.length; idx >= 1; idx--) {
                        let path = tsPathPattern.slice(0, idx).join('/');
                        found = tsPaths.find(p => p[0] && p[0].split('/*')[0] == path);
                        if (found) {
                            break;
                        }
                    }
                }

                if (!found && pathPattern !== '') {
                    try {
                        found = tsPaths.find(p => pathPattern.split(new RegExp(p[0])).length > 1);
                    } catch (err) {
                        found = undefined;
                    }
                }

                if (found) {
                    let refFileName = found[0].split('/*')[0];
                    let baseUrl = tsBaseUrl && tsBaseUrl.split('/').length > 1 ? tsBaseUrl.split('/')[1] + '/' : './';
                    if (Array.isArray(found[1])) {
                        let realPath = found[1][0];
                        if (realPath) {
                            realPath = realPath.replaceAll('/*', '/');
                            fileName = baseUrl + fileName.replace(new RegExp('^' + refFileName), realPath);
                            if (tsRelativePath) {
                                relativePath = null;
                                fileName = tsRelativePath + fileName.replace('.', '');
                            } else {
                                relativePath = relativePath.split('/');
                                let rootPath = realPath ? realPath.split('/')[0] : null;
                                let rootFound = false;

                                relativePath = relativePath.filter(path => {
                                    if (rootFound) {
                                        return false;
                                    }
                                    if (path == rootPath) {
                                        rootFound = true;
                                        return false;
                                    }
                                    return true;
                                });
                                relativePath = relativePath.join('/');
                            }
                        }
                    }
                }

                // Captures only local files

                /**
                 * CASE: Cannot resolve import function from absolute path
                 * Issue: #50
                 */
                if (!fileName.includes('./')) {
                    // Checking if is a project file
                    let extension = await utils.getExtension(fileName);
                    if (fs.existsSync(fileName + extension)) {
                        // is a absolute path
                        fileName = './' + fileName; // TODO: check for possible problems here
                        relativePath = '';
                    } else {
                        let auxPath = ('./' + fileName).replaceAll('//', '/').replaceAll('\\\\', '\\');
                        let extension = await utils.getExtension(auxPath);
                        if (extension) {
                            fileName = auxPath;
                        }
                    }
                }
                /* END CASE */

                if (fileName.includes('./') || knownFunctions.includes(fileName)) {
                    let pathFile = null;
                    if (relativePath) {
                        pathFile = await resolvePathFile(fileName, relativePath);
                    } else {
                        pathFile = fileName;
                    }

                    obj.fileName = pathFile;
                    obj.isDirectory = false;
                    let fileExtension = await utils.getExtension(pathFile);
                    if (fileExtension === '') {
                        obj.isDirectory = fs.existsSync(pathFile) && fs.lstatSync(pathFile).isDirectory() ? true : false;
                        if (obj.isDirectory === false) {
                            fileName = fileName.replace(/^\./, '').replace(/^\//, '').replace(/^\./, '').replace(/^\//, '');
                            let len = fileName.split('/').length * 2;
                            let auxPathFile = pathFile;
                            for (let i = 1; i < len; ++i) {
                                auxPathFile = pathFile;
                                auxPathFile = auxPathFile.split('/');
                                auxPathFile = auxPathFile.slice(0, -1 * i);
                                auxPathFile = auxPathFile.join('/') + '/' + fileName;
                                auxPathFile = auxPathFile.replaceAll('//', '/');
                                if (await utils.getExtension(auxPathFile)) {
                                    obj.fileName = auxPathFile;
                                    break;
                                }
                            }
                        }
                    }

                    // Checking if reference is to file
                    if (obj.isDirectory && obj.exports.length > 0) {
                        let indexExtension = await utils.getExtension(pathFile + '/index');
                        if (indexExtension != '') {
                            // index exist
                            let dataFile = await utils.getFileContent(pathFile + '/index' + indexExtension);
                            if (dataFile) {
                                let imports = await getImportedFiles(dataFile, obj.fileName);
                                for (let idx = 0; idx < obj.exports.length; ++idx) {
                                    let varName = obj.exports[idx].varName;
                                    let idxFound = imports.findIndex(e => e.varFileName && varName && e.varFileName.toLowerCase() == varName.toLowerCase());
                                    let exportPath = null;
                                    if (idxFound == -1) {
                                        imports
                                            .filter(e => e)
                                            .forEach(imp => {
                                                if (exportPath) {
                                                    return;
                                                }
                                                let found = imp && imp.exports ? imp.exports.find(e => e.varName && varName && e.varName.toLowerCase() == varName.toLowerCase()) : null;
                                                if (found) {
                                                    if (imp.isDirectory) {
                                                        exportPath = null;
                                                    } else if (imp.fileName !== 'express') {
                                                        exportPath = imp.fileName; // REFECTOR: change variable name
                                                    }
                                                }
                                            });

                                        if (exportPath) {
                                            let extension = await utils.getExtension(exportPath);
                                            obj.exports[idx].path = exportPath + extension;
                                        }
                                    }

                                    if (idxFound > -1) {
                                        const pathFile = imports[idxFound].fileName;
                                        let extension = await utils.getExtension(pathFile);
                                        obj.exports[idx].path = pathFile + extension;
                                    }
                                }
                            }
                        }
                    } else {
                        // TODO: reference in the file
                    }
                    importedFiles.push(obj);
                }
            }
        }

        // Such as: const foo = required('./foo')
        if (requireds && requireds.length > 0) {
            for (let index = 0; index < requireds.length; ++index) {
                let req = requireds[index];
                let obj = {
                    varFileName: null,
                    fileName: null,
                    exports: []
                };
                let varFileName = req.split(new RegExp(`=\\s*\\t*require\\s*\\t*\\(`, 'i'))[0].trim();

                if (varFileName) {
                    // Issue: #18
                    const origVarFileName = varFileName;
                    try {
                        let instancesRegex = `\\s*\\n*\\t*\\}\\s*\\n*\\t*\\=\\s*${origVarFileName}\\;?\\s+`;
                        let instances = data.replaceAll('\n', ' ').split(new RegExp(instancesRegex));
                        if (instances.length > 1) {
                            instances.pop();
                            let newVarFileName = '{ ';
                            instances
                                .filter(e => e)
                                .forEach(inst => {
                                    let vars = inst.split('{').slice(-1)[0];
                                    newVarFileName += vars + ', ';
                                });
                            newVarFileName += varFileName + ' }';
                            varFileName = newVarFileName;
                        }

                        instancesRegex = `\\s*\\n*\\t*\\s*\\n*\\t*\\=\\s*${origVarFileName}\\;?\\s+`;
                        instances = data.replaceAll('\n', ' ').split(new RegExp(instancesRegex));
                        if (instances.length > 1) {
                            instances.pop();
                            let newVarFileName = '{ ';
                            instances
                                .filter(e => e)
                                .forEach(inst => {
                                    if (inst.trim().slice(-1)[0] == '}') {
                                        return;
                                    }
                                    let varsName = inst.split(' ').slice(-1)[0];
                                    newVarFileName += varsName + ', ';
                                });
                            newVarFileName += varFileName + ' }';
                            varFileName = newVarFileName;
                            varFileName = varFileName.replaceAll(' ', '').replaceAll(',{', ',').replaceAll('{{', '{').replaceAll('}}', '}');
                        }
                    } catch (err) {
                        varFileName = origVarFileName;
                    }
                }
                if (varFileName.includes('{')) {
                    if (varFileName.split(new RegExp(',\\s*\\t*{')).length > 1) {
                        // such as: import foo, { Foo } from './foo'
                        obj.varFileName = varFileName.split('{')[0].replaceAll(',', '').trim();
                    }
                    varFileName = varFileName.replaceAll('\n', '');
                    varFileName
                        .split('{')[1]
                        .split(',')
                        .forEach(exp => {
                            exp = exp.replaceAll('{', '').replaceAll('}', '').replaceAll(',', '').trim();
                            if (exp == '') {
                                return;
                            }

                            if (exp && aliasRegex.test(exp)) {
                                // alias
                                obj.exports.push({
                                    varName: exp.split(aliasRegex)[0],
                                    varAlias: exp.split(aliasRegex)[1],
                                    path: null
                                });
                            } else {
                                obj.exports.push({
                                    varName: exp,
                                    varAlias: null,
                                    path: null
                                });
                            }
                        });
                } else {
                    obj.varFileName = varFileName;
                }

                let fileName = req.split(new RegExp(`=\\s*\\t*require\\s*\\t*\\(`, 'i'))[1].trim();
                fileName = fileName.split(')')[0];
                fileName = fileName.replaceAll("'", '').replaceAll('"', '').replaceAll('`', '').replaceAll(' ', '');
                fileName = fileName.replaceAll('//', '/').replaceAll('//', '/').replaceAll('\\\\', '\\').replaceAll('\\\\', '\\');

                // Captures only local files

                /**
                 * CASE: Cannot resolve import function from absolute path
                 * Issue: #50
                 */
                if (!fileName.includes('./')) {
                    // Checking if is a project file
                    let extension = await utils.getExtension(fileName);
                    if (fs.existsSync(fileName + extension)) {
                        // is an absolute path
                        fileName = './' + fileName; // TODO: check for possible problems here
                        localRelativePath = '';
                    }
                }
                /* END CASE */

                if (fileName.includes('./') || knownFunctions.includes(fileName)) {
                    if (fileName.split(new RegExp(`.json$`, 'i')).length == 1) {
                        // Will not recognize files with .json extension
                        let pathFile = null;
                        if (localRelativePath) {
                            pathFile = await resolvePathFile(fileName, localRelativePath);
                        } else {
                            pathFile = fileName;
                        }

                        obj.fileName = pathFile;
                        obj.isDirectory = false;
                        let fileExtension = await utils.getExtension(pathFile);
                        if (fileExtension === '') {
                            obj.isDirectory = fs.existsSync(pathFile) && fs.lstatSync(pathFile).isDirectory() ? true : false;
                        }

                        // Checking if reference is to file
                        if (obj.isDirectory) {
                            let indexExtension = await utils.getExtension(pathFile + '/index');
                            if (indexExtension != '') {
                                // index exist
                                let dataFile = await utils.getFileContent(pathFile + '/index' + indexExtension);
                                dataFile = await handleData.removeComments(dataFile);
                                const isRequireDirLib = dataFile && dataFile.split(new RegExp('\\s*\\n*\\t*module\\s*\\n*\\t*\\.\\s*\\n*\\t*exports\\s*\\n*\\t*\\=\\s*\\n*\\t*require\\s*\\n*\\t*\\(\\s*\\n*\\t*.require\\-dir.\\s*\\n*\\t*\\)')).length > 1 ? true : false;
                                if (isRequireDirLib) {
                                    // lib require-dir
                                    obj.isRequireDirLib = isRequireDirLib;
                                } else {
                                    // TODO: Verify other cases

                                    let localRelativePath = obj.fileName;
                                    for (let pathIdx = 0; pathIdx < obj.exports.length; ++pathIdx) {
                                        let oExp = obj.exports[pathIdx];

                                        if (dataFile.split(new RegExp(`${oExp.varName}\\s*\\n*\\t*\\=\\s*\\n*\\t*require\\s*\\n*\\t*\\(`)).length > 1) {
                                            let addPath = dataFile.split(new RegExp(`${oExp.varName}\\s*\\n*\\t*\\=\\s*\\n*\\t*require\\s*\\n*\\t*\\(\\s*\\n*\\t*`));
                                            addPath = addPath[1].split(')')[0].replaceAll("'", '').replaceAll('"', '').replaceAll('`', '');
                                            oExp.path = await resolvePathFile(addPath, localRelativePath);
                                        }
                                    }
                                }
                            }
                        }
                        importedFiles.push(obj);
                    }
                }
            }
        }
        return importedFiles;
    } catch (err) {
        return importedFiles;
    }
}
Get require/import content.
@param {string} data
@param {string} localRelativePath