# gulp-tinifier

> A Gulp plugin for compress images with https://tinypng.com service

Latest version **1.0.2** (published 2016-04-30) · ISC license · 0 weekly downloads

## Install

```sh
npm install gulp-tinifier
pnpm add gulp-tinifier
yarn add gulp-tinifier
bun add gulp-tinifier
```

## 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 | 2016-04-30 |
| First published | 2016-04-15 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Pachito Marco Calabrese |
| Maintainers | pmcalabrese |
| Keywords | gulp, gulpplugin, tinypng, tinifier, compress, images |

## Links

- npm: https://www.npmjs.com/package/gulp-tinifier
- Repository: https://github.com/pmcalabrese/gulp-tinifier
- Homepage: https://github.com/pmcalabrese/gulp-tinifier#readme
- Issues: https://github.com/pmcalabrese/gulp-tinifier/issues
- npm.io page: https://npm.io/package/gulp-tinifier

## Dependencies (3)

- [tinify](https://npm.io/package/tinify.md) ^1.3.0
- [through2](https://npm.io/package/through2.md) ^2.0.1
- [gulp-util](https://npm.io/package/gulp-util.md) ^3.0.7

## 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) — 2016-04-30
- 1.0.1 — 2016-04-16
- 1.0.0 — 2016-04-15

## README

# gulp-tinifier
gulp-tinifier is a simple plugin which allows you to compress your images with [https://tinypng.com/](https://tinypng.com/) service

<img src="tinifier.png" width="445" alt="gulp-tinifier in action">

## Install

```bash
  npm install gulp-tinifier --save
```

## How it works
tinifier has a simple sintax accepts one only argument

```javascript

  var tinfier = require('gulp-tinifier');
  
  ...
  
  var options = {
      key:'YOUR_API_KEY',
      verbose: true
  }
  
  gulp.src(imgToCompress)
    .pipe(tinfier(options))
    .pipe(gulp.dest("sprites-optimized", {cwd:distFolder}))
    
  ...
  
```

`options` is an object and has the following proprieties

  - *key* [string] your API key (you can grab it from [https://tinypng.com/developers](https://tinypng.com/developers) )
  - *verbose* [boolean] true by default, it will show the progress in the console
 

## Example

```javascript

var tinfier = require('gulp-tinifier');

var config = require('./gulp.config.js');
var imgToCompress = [
    config.dist + "assets/img/sprite-backgrounds@2x.png",
    config.dist + "assets/img/sprite-backgrounds-mobile@2x.png"
];
var distFolder = config.dist + "assets/img/";

module.exports = function(gulp) {
    return gulp.task("tinypng", function(done) {
        gulp.src(imgToCompress)
            .pipe(tinfier({
                key:'YOUR_API_KEY',
                verbose: true
            }))
            .pipe(gulp.dest("sprites-optimized", {cwd:distFolder}))
    })
}

```

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