const{fork}=require('child_process');const{join}=require('path');const{getClassesMapping,readDir,chunk}=require('./src/utils');constcpus=require('os').cpus().length;constarg=process.argv.slice(2)[0];constmode=arg&&((arg==='reverse')||(arg==='-r'))?'reverse':'forward';constSEARCH_DIR='node_modules';constclassesMapping=getClassesMapping();constfiles=readDir(SEARCH_DIR);console.log(`Jetifier found ${files.length} file(s) to ${mode}-jetify. Using ${cpus} workers...`);for(constfilesChunkofchunk(files,cpus)){constworker=fork(join(__dirname,'src','worker.js'));worker.send({filesChunk,classesMapping,mode});}