# tiny-image-compression-tool

> A simple image compression tool built with Node.js.

Latest version **1.0.2** (published 2024-04-17) · ISC license · 0 weekly downloads

## Install

```sh
npm install tiny-image-compression-tool
pnpm add tiny-image-compression-tool
yarn add tiny-image-compression-tool
bun add tiny-image-compression-tool
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2024-04-17 |
| First published | 2024-03-18 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 4.1 KB |
| Known vulnerabilities | 0 (+4 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Maintainers | penix18 |
| Keywords | image, compression, nodejs, sharp, imagemin |

## Links

- npm: https://www.npmjs.com/package/tiny-image-compression-tool
- Repository: https://github.com/penix18/tiny-image-compression-tool
- Homepage: https://github.com/penix18/tiny-image-compression-tool#readme
- Issues: https://github.com/penix18/tiny-image-compression-tool/issues
- npm.io page: https://npm.io/package/tiny-image-compression-tool

## Dependencies (3)

- [glob](https://npm.io/package/glob.md) ^7.1.6
- [sharp](https://npm.io/package/sharp.md) ^0.28.3
- [imagemin](https://npm.io/package/imagemin.md) ^7.0.1

## Alternatives

- [exif-parser](https://npm.io/package/exif-parser.md) — 3.8M weekly downloads
- [vite-plugin-compression](https://npm.io/package/vite-plugin-compression.md) — 569.5K weekly downloads
- [pica](https://npm.io/package/pica.md) — 442.4K weekly downloads
- [@reportportal/client-javascript](https://npm.io/package/@reportportal/client-javascript.md) — 408.8K weekly downloads
- [@tldraw/state](https://npm.io/package/@tldraw/state.md) — 316.0K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2024-04-17
- 1.0.1 — 2024-03-21
- 1.0.0 — 2024-03-18

## README

# tiny-image-compression-tool

A lightweight Node.js library for compressing images using Sharp and imagemin.

## Installation

You can install `tiny-image-compression-tool` via npm:

```bash
npm install tiny-image-compression-tool
```

## Usage

```javascript
const { compressImages } = require('tiny-image-compression-tool');

// Path to the images you want to compress
const imagesPath = './images/*.{jpg,png}';
// Directory to save the compressed images
const outputDirectory = './compressed';

// Compress images with default width (800px)
compressImages(imagesPath, outputDirectory)
  .then(() => console.log('Images compressed successfully'))
  .catch((error) => console.error('Error compressing images:', error));

// You can also specify a custom width for resizing the images
const customWidth = 600;
compressImages(imagesPath, outputDirectory, customWidth)
  .then(() => console.log('Images compressed successfully with custom width'))
  .catch((error) => console.error('Error compressing images:', error));
```

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

---
_Source: https://npm.io/package/tiny-image-compression-tool · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
