1.0.3 • Published 4 years ago

img-base64-cli v1.0.3

Weekly downloads
-
License
ISC
Repository
github
Last release
4 years ago

img-base64-cli

This package helps you to convert all your base64 to separate images and vice versa and replace paths in your css and html.

Installation

npm i img-base64-cli -g

Usage

base64img --mode <type-of-mode> [--folder <your-folder-path>] [--files <glob-for-your-files>] [--removeImgFolder]

Arguments:

--mode - type of mode. (toImg converts base64 to separate images. toBase64 converts images to base64)

--folder specifies the folder name where your images will be placed. Required only if the type of mode is toImg

--files is optional. Specifies the search pattern for the files you want to parse. If not specified, only ./index.html will be parsed

--removeImgFolder is optional. Removes the folder where your images were placed. Used only in toBase64 mode

Examples:

Decode to separate images from base64

base64img --mode toImg --folder my-img-folder --files ./**/*.html

Will parse all *.html files in folders and subfolders, covert all base64 to separate images, place them to my-image-folder and replace all the paths in html files.

Encode to base64 from images

base64img --mode toBase64 --removeImgFolder

Will parse index.html file in the root folder, covert all images to base64 with replacing all the paths and also remove folder(s) where the source images were placed


Based on base64-img

1.0.3

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago