# smosh

> smosh [![Build Status](https://travis-ci.org/heldr/smosh.svg?branch=master)](https://travis-ci.org/heldr/smosh) =====

Latest version **1.2.0** (published 2016-03-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install smosh
pnpm add smosh
yarn add smosh
bun add smosh
```

## 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.2.0 |
| Published | 2016-03-27 |
| First published | 2014-10-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.10 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Helder Santana |
| Maintainers | helder |
| Keywords | image, compressor, compression |

## Links

- npm: https://www.npmjs.com/package/smosh
- Repository: https://github.com/heldr/smosh
- Homepage: https://github.com/heldr/smosh#readme
- Issues: https://github.com/heldr/smosh/issues
- npm.io page: https://npm.io/package/smosh

## 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.2.0 (latest) — 2016-03-27
- 1.1.0 — 2015-09-09
- 1.0.0 — 2015-09-05
- 0.2.1 — 2014-11-22
- 0.2.0 — 2014-11-22
- 0.1.0 — 2014-10-14
- 0.0.3 — 2014-10-14
- 0.0.2 — 2014-10-11
- 0.0.1 — 2014-10-11

## README

smosh [![Build Status](https://travis-ci.org/heldr/smosh.svg?branch=master)](https://travis-ci.org/heldr/smosh)
=====

A middleware between [resmushit](http://resmush.it/) and streams on top of [vinyl](https://www.npmjs.com/package/vinyl).

How to use?
------------

```shell
npm install smosh --save
```

```javascript
var smosh = require('smosh'),
    file  = smosh(vinylFile),
    data  = '';

file.on('data', function(chunk) {
    // file chunk stream
    data += chunk;
});

file.on('end', function(newBuffer, info) {
    // vinyl metadata if previously given
    console.log(newBuffer.toString());
    // or if data is streamed
    console.log(data);
    // percentage compressed
    console.log(info.percent)
});

file.on('error', function(err) {
    throw err;
});
```

## License

MIT © [Helder Santana](https://github.com/heldr)


Based on: [node-smushit](https://github.com/colorhook/node-smushit)

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