中文
A simple Node.js script for compressing PNG format images using the TinyPNG API.
-
Clone the repository:
git clone https://github.com/lidppp/zippng-node.git cd zippng yarn install
-
Install dependencies:
npm install -g zippng
zippng [-r|-v|-h|-s key]
-r
: Recursively search for PNG files.-v
: View version.-h
: Help documentation.-s key
: Set TinyPNG API Key.
The script requires a TinyPNG API key. You can refer to the TinyPNG documentation for the application process.
Configure using zippng -s YOUR_API_KEY
# Compress PNG files in the current directory
zippng
# Recursively compress PNG files
zippng -r
# Set TinyPNG API Key
zippng -s YOUR_API_KEY
Check the version of the script:
zippng -v
View help documentation:
zippng -h
- If an API key is not provided or an incorrect API key is provided, the script will not run as expected.
- For more details on TinyPNG API, refer to TinyPNG Developers.
This project is licensed under the MIT License - see the LICENSE file for details.