pdfmin is a CLI tool to compress PDF using GhostScript.
GhostScript must be installed on your device !
sudo apt-get install -y ghostscript
Go to https://ghostscript.com/releases/gsdnld.html and download the installer corresponding to your Windows version.
Install GhostScript using the installer.
npx pdfmin ./myFile.pdf
npx pdfmin ./myFile.pdf ./myFile2.pdf
npx pdfmin ./myFolder/
npx pdfmin ./myFolder/ ./myFolder2/