GithubHelp home page GithubHelp logo

js-image-optimizer's Introduction

js-image-optimizer

NodeJS server that optimizes images based on URL and Accept header.

Usage

Start server and call using full URL as path. Something like this should probably work: http://localhost:8080/http://www.personal.psu.edu/crd5112/photos/PNG%20Example.png

Server will download given URL, and stream it to the user based on extension in URL and Accept header sent. Make sure you put this somewhere in your infrastructure where the possible URLs sent to the server is limited. We use it behind Varnish as well, to avoid optimizing images over and over every time user requests it.

Running on windows

To run this locally on Windows, you can use the included binary tools. All you need to install externally is "svgo" through npm: npm install -g svgo

Running on linux

On linux you will have to download and compile jpeg-archive (jpeg-recompress), pngquant, cwebp from your favorite package manager / source and install svgo from npm.

Docker base image

All the different command line apps are installed and ready to use in the docker base image used by the build process. You can read more about how to change the base image in BASEFILE.md

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.