Skip to content

frostoven/Squoosh-with-CLI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fork details

Google has removed all CLI features from their Squoosh project.

This fork merges newer Squoosh browser features with the old removed CLI stuff. It does not aim to strictly retain compatibility with the original project, but does aim to preserve old CLI functionality, including the UI CLI command generator.

Usage:

Maintenance info

For now, the core purpose of this fork is to fix bugs in the CLI portion of the code. The CLI portion had quite a few problems when it was retired from the original project, many of which are now fixed in this fork.

I maintain these features and fix bugs in my spare time, and generally have my hands full with an indie game I'm making. Please consider supporting my work to get more hands on deck; I would like to hire someone to work on this project full-time so that it may reach its full potential.

Change from the original

First off, I'd like to give a huge thank you to everyone who has contributed to this fork!

Major changes:

  • Fixes an issue where the original Squoosh CLI would attempt to consume all target images at once, causing Node to crash when dealing with data exceeding ~500MB (the max concurrent image limit is now automatically set to your CPU core count, override with -c your_number). This fork has been confirmed to work with datasets exceeding 10GB containing thousands of images.
  • Fixes an issue where the CLI terminal output would corrupt when processing a large amount of images.
  • The original CLI tool ignored almost all custom user options. This is (hopefully) completely fixed now.
  • This fork adds Node 18+ support.

Build info

Important: Always delete .tmp and build before doing a prod build, and delete .tmp if you're experiencing weird bugs during development. It appears to occasionally get corrupted by some process duplication.

This fork introduces additional pages as static HTML. I didn't have the time to figure out how to correctly hook this up into the dev process (though it's integrated into prod); for now, static pages can be tested in dev with npx http-server staticPages.


The original README follows below.


Squoosh is an image compression web app that reduces image sizes through numerous formats.

Privacy

Squoosh does not send your image to a server. All image compression processes locally.

However, Squoosh utilizes Google Analytics to collect the following:

  • Basic visitor data.
  • The before and after image size value.
  • If Squoosh PWA, the type of Squoosh installation.
  • If Squoosh PWA, the installation time and date.

Developing

To develop for Squoosh:

  1. Clone the repository
  2. To install node packages, run:
    npm install
  3. Then build the app by running:
    npm run build
  4. After building, start the development server by running:
    npm run dev

Contributing

Squoosh is an open-source project that appreciates all community involvement. To contribute to the project, follow the contribute guide.