Giter VIP home page Giter VIP logo

compressify's Introduction

compressify

Image compression executable to run as pre or post-commit. Compresses images in the same place, builds hash-manifest and stages changed images.

Install

npm install --save-dev https://github.com/moovel/compressify.git

Usage

Image compression can run as standalone CLI command or used in combination with husky as pre-commit. It will try to read the --manifest file and filter the already compressed images. The remaining images in the pipe will be compressed using mozjpeg and added to the stage. After compression takes place the hash manifest will be recreated, added to the stage and everything is committed.

// package.json
{
  "scripts": {
    "precommit": "npm run compress",
    "compress": "compressify --dest 'content' --src 'content/**/*.{jpg,jpeg,png}' --manifest 'image-manifest.json'"
  },
  "devDependencies": {
    "husky": "^0.14.3",
    "compressify": "git+https://github.com/moovel/compressify.git"
  }
}

API

--src
type string
required true
desc source path of images
example 'content/**/*.{jpg,jpeg,png}'
--dest
type string
required true
desc destination path of images
example 'content'
--manifest
type string
required true
desc desc: path to hash manifest
example 'image-manifest.json'
--gitadd
type bool
default true
required false
desc if images should be staged after compression
example false

compressify's People

Contributors

marcobiedermann avatar tderleth avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

compressify's Issues

Order manifest by key

Keys in the manifest file should perhaps be sorted by key. This way merges will be much cleaner among commits.

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.