🐼 A cli can automatically compress images with tinypng.com

Overview

easy-tinypng-cli

A cli can automatically compress images with tinypng.com.

NPM version

Why

When delevoping a website, we often need to compress images to reduce the network io cast.In normal way, we may need four steps to compress images:

  1. download images from the internet
  2. upload the image to tinypng.com
  3. download the compressed image from tinypng.com
  4. copy the compressd images into our workspace

The above steps are very time-consuming. So !!! this cli can automatically compress images in background process. It will watch the fileSystem changes to auto handle if there are any images that need to be compressed.

πŸš€ Features

  • πŸ’Ύ Support configuration file
  • 🍁 Multiple directory watching
  • ✨ Support HMR
  • πŸ¦‹ Auto detection nested directory images and compress them
  • 🌝 Background process will not block the main thread
  • πŸ»β€β„οΈ Compressed record logging to avoid repeated compression

vite-plugin-vue-inspector

Usage

Install

pnpm add -D easy-tinypng-cli

Config tiny.config.ts

  • APIKey (required) : the API key of tinypng.com, you can get it from tinypng.com

  • targetDir (required) : the top directory that you want to compress images

import { defineTinyConfig } from 'easy-tinypng-cli/utils'

export default defineTinyConfig({
  configs: [
    {
      targetDir: './src/images',
    },
  ],
  APIKey: 'xxxxxxxxx',
})

Add Script in package.json

{
  "scripts": {
    "optimizeImages": "tiny"
  }
}

or

{
  "scripts": {
    "optimizeImages": "tiny --once" //only compress once no watching files change
  }
}

Author

sudongyuer email:[email protected]

License

MIT License Β© 2021 SuDongYu

Comments
  • [ImgBot] Optimize images

    [ImgBot] Optimize images

    Beep boop. Your images are optimized!

    Your image file size has been reduced by 14% πŸŽ‰

    Details

    | File | Before | After | Percent reduction | |:--|:--|:--|:--| | /packages/client/src/images/long-zhu.png | 2,783.70kb | 2,394.07kb | 14.00% | | /packages/client/public/vite.svg | 1.46kb | 1.42kb | 2.81% | | /packages/client/src/assets/react.svg | 4.03kb | 4.02kb | 0.15% | | | | | | | Total : | 2,789.19kb | 2,399.51kb | 13.97% |


    πŸ“ docs | :octocat: repo | πŸ™‹πŸΎ issues | πŸͺ marketplace

    ~Imgbot - Part of Optimole family

    opened by imgbot[bot] 1
  • chore: update versions

    chore: update versions

    This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to master, this PR will be updated.

    Releases

    [email protected]

    Patch Changes

    • 60d77d4: improve record json
    opened by sudongyuer 0
  • chore: update versions

    chore: update versions

    This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to master, this PR will be updated.

    Releases

    [email protected]

    Minor Changes

    • d030aab: feat: support compand --once
    opened by sudongyuer 0
  • chore: update versions

    chore: update versions

    This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to master, this PR will be updated.

    Releases

    [email protected]

    Minor Changes

    • 6289760: release v0.3.0 all fn depend on relative path
    opened by sudongyuer 0
  • chore: update versions

    chore: update versions

    This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to master, this PR will be updated.

    Releases

    [email protected]

    Patch Changes

    • 4da2127: typo fix
    opened by sudongyuer 0
  • chore: update versions

    chore: update versions

    This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to master, this PR will be updated.

    Releases

    [email protected]

    Patch Changes

    • 9a44814: update package.json
    opened by sudongyuer 0
  • chore: update versions

    chore: update versions

    This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to master, this PR will be updated.

    Releases

    [email protected]

    Patch Changes

    • b9dc668: update README.md
    opened by sudongyuer 0
  • chore: update versions

    chore: update versions

    This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to master, this PR will be updated.

    Releases

    [email protected]

    Patch Changes

    • 223b754: update loading state
    opened by sudongyuer 0
  • chore: update versions

    chore: update versions

    This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to master, this PR will be updated.

    Releases

    [email protected]

    Patch Changes

    • 8a6b2ef: release v0.2.1
    • 4a2d519: update package.json keywords desc
    opened by sudongyuer 0
  • chore: update versions

    chore: update versions

    This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to master, this PR will be updated.

    Releases

    [email protected]

    Patch Changes

    • fbb2982: release v0.2.1
    opened by sudongyuer 0
  • chore: update versions

    chore: update versions

    This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to master, this PR will be updated.

    Releases

    [email protected]

    Minor Changes

    • d3f6ec1: release v0.1.0

    Patch Changes

    • 00636d0: refactor name
    • e53afb8: update ci
    opened by sudongyuer 0
  • Configure Renovate

    Configure Renovate

    Mend Renovate

    Welcome to Renovate! This is an onboarding PR to help you understand and configure settings before regular Pull Requests begin.

    🚦 To activate Renovate, merge this Pull Request. To disable Renovate, simply close this Pull Request unmerged.


    Detected Package Files

    • .github/workflows/changeset-version.yml (github-actions)
    • package.json (npm)
    • packages/client/package.json (npm)
    • packages/easy-tinypng-cli/package.json (npm)

    Configuration

    πŸ”‘ Renovate has detected a custom config for this PR. Feel free to ask for help if you have any doubts and would like it reviewed.

    Important: Now that this branch is edited, Renovate can't rebase it from the base branch any more. If you make changes to the base branch that could impact this onboarding PR, please merge them manually.

    What to Expect

    With your current configuration, Renovate will create 8 Pull Requests:

    chore(deps): pin dependencies
    chore(deps): update dependency unbuild to v0.8.10
    • Schedule: ["at any time"]
    • Branch name: renovate/unbuild-0.x
    • Merge into: master
    • Upgrade unbuild to 0.8.10
    chore(deps): update dependency vitest to v0.22.1
    • Schedule: ["at any time"]
    • Branch name: renovate/vitest-0.x
    • Merge into: master
    • Upgrade vitest to 0.22.1
    chore(deps): update actions/checkout action to v3
    • Schedule: ["at any time"]
    • Branch name: renovate/actions-checkout-3.x
    • Merge into: master
    • Upgrade actions/checkout to v3
    chore(deps): update actions/setup-node action to v3
    • Schedule: ["at any time"]
    • Branch name: renovate/actions-setup-node-3.x
    • Merge into: master
    • Upgrade actions/setup-node to v3
    chore(deps): update dependency pnpm to v7
    • Schedule: ["at any time"]
    • Branch name: renovate/pnpm-7.x
    • Merge into: master
    • Upgrade pnpm to 7.9.5
    chore(deps): update dependency vite to v3
    • Schedule: ["at any time"]
    • Branch name: renovate/vite-3.x
    • Merge into: master
    • Upgrade vite to 3.0.9
    fix(deps): update dependency chalk to v5
    • Schedule: ["at any time"]
    • Branch name: renovate/chalk-5.x
    • Merge into: master
    • Upgrade chalk to 5.0.1

    🚸 Branch creation will be limited to maximum 2 per hour, so it doesn't swamp any CI resources or spam the project. See docs for prhourlylimit for details.


    ❓ Got questions? Check out Renovate's Docs, particularly the Getting Started section. If you need any further assistance then you can also request help here.


    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 1
Owner
Frozen FIsh
βŠ™οΉβŠ™β€–βˆ£Β° 🐟🐟🐟
Frozen FIsh
πŸ—œοΈ AstroJS compression utilities. Compress CSS, HTML, JavaScript and more.

astro-compress ??️ This Astro integration brings compression utilities to your Astro project. csso html-minifier-terser terser Installation There are

Nikola Hristov 144 Jan 8, 2023
✨ A cli can automatically export files of the same type

auto-export A cli can automatically export files Why When you want to export many files of the same type in one folder, you may cost a lot of time to

Frozen FIsh 22 Aug 11, 2022
🌸 A cli can automatically generate files from Excel files.

unxlsx A cli can automatically generate files from Excel files. Why We often need to export some information from XLSX to generate our files, such as

Frozen FIsh 24 Aug 22, 2022
Fallback for SVG images by automatically creating PNG versions on-the-fly

SVGMagic - Cross browser SVG This repository is no longer actively mainted. It has proven to be very usefull back in 2013, but these days SVGs are sup

Dirk Groenen 596 Jul 27, 2022
Compare James Webb Space Telescope images to older images.

How much more powerful is the James Webb Space Telescope when compared to Hubble? Find out! More info Want to help out? CONTRIBUTING.md Blog post with

John Christensen 399 Jan 3, 2023
Simple jQuery plugin that will allow users to zoom in your images, perfect for product images and galleries.

Image Zoom (jQuery) Plugin Simple jQuery plugin that will allow users to zoom in your images, perfect for product images and galleries that is less th

Mario Duarte 8 Aug 3, 2022
Easiest 1-click way to install and use Stable Diffusion on your own computer. Provides a browser UI for generating images from text prompts and images. Just enter your text prompt, and see the generated image.

Stable Diffusion UI Easiest way to install and use Stable Diffusion on your own computer. No dependencies or technical knowledge required. 1-click ins

null 3.5k Dec 30, 2022
MidJourney is an AI text-to-image service that generates images based on textual prompts. It is often used to create artistic or imaginative images, and is available on Discord and through a web interface here.

Midjourney MidJourney is an AI text-to-image service that generates images based on textual prompts. It is often used to create artistic or imaginativ

Andrew Tsegaye 8 May 1, 2023
Simple CLI to warm the cache of social images in all pages from a sitemap.

warm-social-images Simple CLI to warm the cache of social images in all pages from a sitemap. Why Using serverless functions to generate images for so

Travis Fischer 9 Jul 7, 2022
Node-cli-starter - Basic starter kit for building Node CLI applications with TypeScript.

node-cli-starter Minimal starter kit for building Node CLI applications with TypeScript. Getting Started To get started clone repo locally and run npm

Cory Rylan 7 May 17, 2022
A CLI tool to create a NodeJS project with TypeScript CTSP is a CLI tool to make easier to start a new NodeJS project and configure Typescript on it.

CTSP- Create TS Project A CLI tool to create a NodeJS project with TypeScript CTSP is a CLI tool to make easier to start a new NodeJS project and conf

Jean RodrΓ­guez 7 Sep 13, 2022
This is a test parser which can automatically parse the tests in from websites like codeforces, codechef, atcoder etc.

βœ” Sublime test parser This is a test parser which can automatically parse the tests in from websites like codeforces, codechef, atcoder etc. See how i

Prakhar Rai 15 Aug 6, 2022
This simple extension can automatically load NBN availability information for properties on realestate.com.au & domain.com.au including technology type, maximum line speed, and co-existance status if available.

NBN Availability Check Chrome Extension This simple extension can automatically load NBN availability information for properties on realestate.com.au

Luke Prior 17 Aug 17, 2022
A javascript written program that can be used to automatically join BloxFlip Rains.

Toxic Rainer Auto-BloxFlip Rain Joiner Toxic Rainer is a web-socket based background running program used to automatically join BloxFlip Rains to get

null 4 Jul 10, 2022
This is a project that is used to execute python codes in the web page. You can install and use it in django projects, You can do any operations that can be performed in python shell with this package.

Django execute code This is a project that is used to execute python codes in the web page. You can install and use it in django projects, You can do

Shinu 5 Nov 12, 2022