https://github.com/mtpontes/image-converter
CLI image format converter
https://github.com/mtpontes/image-converter
cli-app image-manipulation inquirer nodejs sharp
Last synced: 7 months ago
JSON representation
CLI image format converter
- Host: GitHub
- URL: https://github.com/mtpontes/image-converter
- Owner: mtpontes
- Created: 2024-07-27T23:14:22.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-07-30T17:57:53.000Z (about 1 year ago)
- Last Synced: 2025-01-28T11:48:11.522Z (9 months ago)
- Topics: cli-app, image-manipulation, inquirer, nodejs, sharp
- Language: JavaScript
- Homepage:
- Size: 20.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Image Converter
This is a fast and straightforward CLI client. This CLI helps you convert images from one format to another by taking all the image files in the target format directory and converting them to the desired format. I created this CLI for personal use and am now making it publicly available. I use it in situations where I need to convert batches of images to another format, so if that's what you need, it should help you.
## 🔎 Image formats
- JPG/JPEG
- PNG
- WEBP
- AVIF
- SVG## ⚙️ Main Functions
| Function | Input | Required | Description |
|-----------------------|--------|----------|--------------------------------------------------------------------------------------|
| `menuSourceFormat` | string | true | Menu to choose the image format to be converted |
| `menuExpectedFormat` | string | true | Menu to choose the desired image format |
| `menuSourceFolder` | string | true | Prompts for the address where the images to be converted are located and validates the address. Example input: `E:\images` |
| `menuDestinyFolder` | string | false | Prompts for the destination directory of the images. If no destination directory is specified, the conversions will be sent to the **default_destination** directory at the project root |## 🚀 Installation
### 📋 Prerequisites
- npm
- Node 22 (may also work on versions higher than 12.0)### 📦 Installing
Clone the repository:git clone https://github.com/mtpontes/image-converter.git
Install the dependencies:
npm install
Run the CLI:
node cli.js
## 🤔 FAQ
- **Question**: What happens if the destination directory does not exist?
- **Answer**: The CLI will create the destination directory if it does not exist.