1.0.2 • Published 6 months ago

pic-press v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

šŸ“ø Node Image Compressor

A simple and lightweight Node.js package for compressing images using the sharp library.

šŸš€ Features

āœ… Easy to use
āœ… Supports JPEG compression
āœ… CLI support for quick compression
āœ… Works in both Node.js applications and command-line tools


šŸ“¦ Installation

Install Globally (for CLI use)

npm install -g pic-press

Now you can use the compress command in your terminal.

Install Locally (for Node.js projects)

npm install pic-press

šŸ”§ Usage

1ļøāƒ£ Using CLI

Run the following command to compress an image:

compress <inputPath> <outputPath> [quality]
  • → Path to the input image.
  • → Path to save the compressed image.
  • quality → Compression quality (default: 80, range: 1-100).

Example

compress input.jpg output.jpg 70

This will compress input.jpg to output.jpg with 70% quality.

2ļøāƒ£ Using in a Node.js Project

import the package

const { compressImage } = require("pic-press");

Example code:

const { compressImage } = require("pic-press");

const inputPath = "input.jpg";
const outputPath = "compressed.jpg";
const quality = 75;

compressImage(inputPath, outputPath, quality)
  .then(() => console.log("Compression successful!"))
  .catch((err) => console.error("Error:", err));

šŸ›  Requirements

  • Node.js v12 or later.
  • sharp package (installed automatically).

šŸ“„ License

This project is licensed under the MIT License.

šŸ’” Contributing

Contributions are welcome! Feel free to open an issue or submit a pull request.

šŸ“¬ Support

If you encounter any issues, please open an issue on GitHub. Happy Coding! šŸš€

---

### **Next Steps**
- Replace `your-username` with your GitHub username in the links.  
- Once your package is published, update the actual **npm URL** in the badges.  

Let me know if you want any changes! šŸš€
1.0.2

6 months ago

1.0.1

6 months ago

1.0.0

6 months ago