# thumbnail-stream

> generate thumbnails from a stream of png buffers

Latest version **0.1.0** (published 2016-01-23) · BSD license · 0 weekly downloads

## Install

```sh
npm install thumbnail-stream
pnpm add thumbnail-stream
yarn add thumbnail-stream
bun add thumbnail-stream
```

Provides the command `thumbnailstream`.

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2016-01-23 |
| First published | 2016-01-23 |
| Weekly downloads | 0 |
| License | BSD |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Mapbox |
| Maintainers | emilymcafee |

## Links

- npm: https://www.npmjs.com/package/thumbnail-stream
- npm.io page: https://npm.io/package/thumbnail-stream

## Dependencies (1)

- [mapnik](https://npm.io/package/mapnik.md) ^3.4.12

## Recent versions

- 0.1.0 (latest) — 2016-01-23

## README

# thumbnail-stream

[![Build Status](https://travis-ci.com/mapbox/thumbnail-stream.svg?token=dkVUTgL9esjwon3C6rN3&branch=master)](https://magnum.travis-ci.com/mapbox/thumbnail-stream)

Generates thumbnails from a stream of PNG buffers.

```js
var thumbnailStream = require('thumbnail-stream').ThumbnailStream({ size: 250, sample: 2 });
var writePNGStream = require('thumbnail-stream').WritePNGStream('./tmp');
process.stdin
    .pipe(split())
    .pipe(thumbnailStream)
    .pipe(writePNGStream)
```

**ThumbnailStream**: input is a png buffer, output is png buffer resized to a thumbnail. Expects an object of options, all of which are optional.

Parameter | Description | Default
----------|-------------|--------
size | length of 1 side of resulting thumbnail | 350
sample | to only generate thumbnails for every `n`th buffer | 1

**WritePNGStream**: input is a png buffer, output is pngs written to provided location. Expects a path to where the pngs should be written. 

-------

## thumbnailstream

`thumbnailstream <baseurl> <size>`

This module also provides a cli wrapper command that replays requests against a `<baseurl>` generating png buffers, and captures the output as thumbnails in ./tmp. Expects paths to be piped to `stdin`. (Optional) `<size>` length of 1 side of resulting thumbnail, defaults to 350. Uses request stream from [cloudfront-log-reader](https://github.com/mapbox/cloudfront-log-reader).

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