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