Im working on large project and we have multiple npm packages.
I want to install all the packages in parallel which mean that i want all of to run on the same time (to save time) and once the last install has finished to continue with my script.
Example script:
#!/bin/zsh
#...
NPM_FOLDERS=(
    common.library/audit
    common.library/cipher
    common.library/logger
    ...
)
# Get the number of total folders to process
counter=${#NPM_FOLDERS[@]};
# counter for user feedback to the current install folder index
index=1;
# loop and install all the required packages
for folder in $NPM_FOLDERS;
do 
    #  Print the installation message with the folder & couters
    echo "\033[38;5;255m($index/$counter) Executing npm install in: \033[38;5;226m$folder";
    
    # change the folder to the required location    
    cd $ROOT_FOLDER/$folder;
    
    # Execute install on this folder
    npm install ;
   
    # increase current index
    let index++;
done
echo
echo "\033[38;5;11mInstallation completed."
echo 
In not going to accept the fastest answer but the one who will do what i wish to do and do not have the right knowledge on how to do it, so you can tale the time and give a full answer.
Thank you very much in advance.
 
     
    