Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 1 addition & 47 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,9 @@

# 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](https://arjan.tools/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:

- [Terser](https://github.com/terser/terser)
- [csso](https://github.com/css/csso)
- [html-minifier](https://github.com/kangax/html-minifier)
- [Sharp](https://github.com/lovell/sharp)
- [svgo](https://github.com/svg/svgo)
## Formats supported
| **Input** | **Module used** | **Output** | **options** | **reason used** |
| --------- | --------------- | ---------- | ------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| html | html-minifier | html | options | [best compression](https://www.npmjs.com/package/html-minifier#minification-comparison) |
| css | csso | css | [options](https://www.npmjs.com/package/csso#minifysource-options) | [best](http://goalsmashers.github.io/css-minification-benchmark/) overall size+[speed+compression](http://goalsmashers.github.io/css-minification-benchmark/) |
| js | terser | js | Parse, Compress, Mangle | support for [ES6](http://www.ecma-international.org/ecma-262/6.0/), best speed & compression |
| svg | svgo | svg | [options](https://www.npmjs.com/package/svgo#what-it-can-do) | most widely used open source option |
| jpeg | sharp | jpeg | options | [fastest option](https://sharp.pixelplumbing.com/performance#results) |
| png | sharp | png | options | fastest option |
| webp | sharp | webp | options | fastest option |
| gif | sharp | png | options | fastest option |
| tiff | sharp | tiff | options | fastest option |
Arjan Optimize is an API that extends the Arjan CLI optimize command that uses webpack to optimize html multipage sites. For now the API only features a method for converting images to WebP but more methods are comming soon!

## Webp Images

Expand All @@ -54,27 +30,5 @@ this will be replaced by:
<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](https://arjan.tools/docs)