Coder Social home page Coder Social logo

image-optimizer's Introduction

image-optimizer

sharp を使って画像圧縮する cli

Install

$ npm i -D @hisho/image-optimizer
# or
$ yarn add -D @hisho/image-optimizer

Feature

  1. src/iamges/**/*\.(png|jpg)public/images/**/*\.(png|jpg)に圧縮しコピーする
  2. src/iamges/**/*\.(png|jpg)public/images/**/*\.(png|jpg).webpに変換し出力する
  3. src/iamges/**/*\.(png|jpg)[640, 828, 1080, 1200, 1920]の大きさにリサイズする
  4. src/lib/images.ts画像のpathをマッピングしたファイルを出力する
  5. -wまたは--watchをつけるとファイルを監視する

Usage

package.json の scripts に以下を追加する

{
  "scripts": {
    "watch:image": "image-optimizer --watch",
    "build:image": "image-optimizer"
  }
}

TODO

  • オプションを受け取れるようにする
  • マッピングファイルの出力の有無を指定できるようにする
  • 画像の圧縮率を変更できるようにする
  • 画像のリサイズを変更できるようにする
  • 出力と入力を自由に設定できるようにする

image-optimizer's People

Contributors

hisho avatar

Watchers

 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.