GithubHelp home page GithubHelp logo

chrisquinnr / chonkr Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 1.7 MB

Files too big? Hosting too small? Reign in those 4k hero images with chonkr, a one-stop shop to resize those bloated images in your project.

JavaScript 100.00%
images performance

chonkr's Introduction

Chonky logo

CHONKR

Use

npm install chonkr -g

// from any directory
chonkr

//or! use direct without install
npx chonkr

chonkr will recursively loop through current and subdirectories to find any jpgs or pngs. It will find any above a given threshold (100kb at the moment, but configurable option coming soon) and list the files found. You can then optionally compress the files.

Example usage

Why

Inspired by #LetsGreenTheWeb, I wanted to make a simple CLI tool to help devs check their projects for any cheeky/chonky large images that may have crept in (we've all done it).

Hopefully running chonkr before you ship will catch (and compress) any large images and contribute to reducing overheads & energy consumption (as well as making your project faster to load, right?).

This is a personal/side project and should probably not be used in production (there are many many grunt/build tools that do this same thing far better than I)

Notes

  • only for .jpg & /png
  • chonkr overwrites images!
  • we copy the compressed images into a temporary folder - tested on *nix systems, not on Windows.
  • 100kb is default threshold at the minute
  • compression ratios are fixed!
  • you can optionally pass a directory e.g. `npx chonkr '../../lolcats/'

chonkr's People

Contributors

chrisquinnr avatar

Stargazers

 avatar James G. Best avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.