Skip to content

Wrapper for mozjpeg binaries (cjpeg, djpeg, jpegtran, rdjpgcom, tjbench and wrjpgcom).

License

Notifications You must be signed in to change notification settings

itgalaxy/mozjpeg-binaries

Folders and files

NameName
Last commit message
Last commit date

Latest commit

17c3f58 · Sep 18, 2018

History

4 Commits
Sep 18, 2018
Sep 18, 2018
Sep 18, 2018
Sep 18, 2018
Sep 18, 2018
Sep 18, 2018
Sep 18, 2018
Sep 18, 2018
Sep 18, 2018
Sep 18, 2018
Sep 18, 2018
Sep 18, 2018
Sep 18, 2018
Sep 18, 2018

Repository files navigation

mozjpeg-binaries

NPM version Travis Build Status dependencies Status devDependencies Status

Wrapper for mozjpeg binaries.

mozjpeg is a production-quality JPEG encoder that improves compression while maintaining compatibility with the vast majority of deployed decoders

You probably want imagemin-mozjpeg-full instead.

What is difference between mozjpeg-bin:

  • Contains all binaries delivered by mozjpeg: cjpeg, djpeg, jpegtran, rdjpgcom, tjbench and wrjpgcom.
  • No security vulnerabilities.
  • Latest version.

Installation

$ npm install mozjpeg-binaries

Usage

const { execFile } = require("child_process");
const binaries = require("mozjpeg-binaries");

// `binaries` contains:
// - cjpeg (original `mozjpeg` binary)
// - djpeg
// - jpegtran
// - rdjpgcom
// - tjbench
// - wrjpgcom

execFile(binaries.cjpeg, ["-outfile", "output.jpg", "input.jpg"], err => {
  console.log("Image minified!");
});

CLI

$ npm install --global mozjpeg
$ cjpeg --help
$ djpeg --help
$ jpegtran --help
$ rdjpgcom --help
$ tjbench --help
$ wrjpgcom --help

About

Wrapper for mozjpeg binaries (cjpeg, djpeg, jpegtran, rdjpgcom, tjbench and wrjpgcom).

Resources

License

Stars

Watchers

Forks

Packages

No packages published