0.6.6 • Published 4 years ago

arjan-optimize v0.6.6

Weekly downloads
5
License
MIT
Repository
github
Last release
4 years ago

License Build Status

Arjan Optimize

Intro

Arjan Optimize helps you optimize all of your static assets with a single command. It takes into account several of the modern web dev directives and uses some of the most popular node modules for minification/compression of assets with a couple of neat features of its own. For more info read the docs

How it works

Arjan optimize scans your current directory recursively and for each file with a different module depending on the files MIME type. Arjan Optimize uses:

Formats supported

InputModule usedOutputoptionsreason used
htmlhtml-minifierhtmloptionsbest compression
csscssocssoptionsbest overall size+speed+compression
jsterserjsParse, Compress, Manglesupport for ES6, best speed & compression
svgsvgosvgoptionsmost widely used open source option
jpegsharpjpegoptionsfastest option
pngsharppngoptionsfastest option
webpsharpwebpoptionsfastest option
gifsharppngoptionsfastest option
tiffsharptiffoptionsfastest option

Webp Images

The webp option in Arjan Optimize does 2 things:

  1. converts all your images to webp using sharp and saves them (without overwritting images in original format)
  2. In the HTML files, it replaces each img tag with a picture tag that holds both its original compressed version and its webp version.

    Because webp is a relatively new format, it is not supported by all browsers. The picture tag is a solution that allows unsupported browsers to fall back to the original version of the image. This article goes more in depth on webp and the picture tag.

    suppose we have the following image tag:

this will be replaced by:

<picture>
  <source type="image/webp" srcset="img/arjan-logo.png">
  <source type="image/png" srcset="img/arjan-logo.png">
  <img src="img/arjan-logo.png" class="img-fluid">
</picture>
  

CLI command

arjan optimize SITENAME FILENAME --img --webp --responsive --html --css --rcss --js

USAGE
  $ arjan optimize [FILENAME]

ARGUMENTS
  FILENAME  name of the file i.e. index.html

OPTIONS
  -c, --css     minifiy css using cssnano
  -h, --html    compress html using html-minifier
  -i, --images  compress images and if possible maintain the format, otherwise its converted to png.
  -j, --js      minify js using uglify js

  -w, --webp    saves a webp version of each image, then replaces each image instance in the html files with a picture tag.
  

Programmatic usage

For more info read the docs

0.6.6

4 years ago

0.6.5

4 years ago

0.6.4

4 years ago

0.6.3

4 years ago

0.6.2

4 years ago

0.6.1

4 years ago

0.6.0

4 years ago

0.5.0

4 years ago