# express-image-render

> An express image processor and renderer

Latest version **1.0.4** (published 2021-06-01) · ISC license · 0 weekly downloads

## Install

```sh
npm install express-image-render
pnpm add express-image-render
yarn add express-image-render
bun add express-image-render
```

## 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.4 |
| Published | 2021-06-01 |
| First published | 2021-04-15 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 4.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Ricardo Alves |
| Maintainers | ricardo_alves |
| Keywords | express, image, process, render, compressor |

## Links

- npm: https://www.npmjs.com/package/express-image-render
- Repository: https://github.com/EFXPROMedia/express-image-render
- Homepage: https://github.com/EFXPROMedia/express-image-render#readme
- Issues: https://github.com/EFXPROMedia/express-image-render/issues
- npm.io page: https://npm.io/package/express-image-render

## Dependencies (1)

- [express](https://npm.io/package/express.md) ^4.17.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.4 (latest) — 2021-06-01
- 1.0.3 — 2021-05-12
- 1.0.2 — 2021-04-19
- 1.0.1 — 2021-04-15
- 1.0.0 — 2021-04-15

## README

This is an express middleware image render and processor, designed with image performance in mind, this module has proven powerful to deal with loads of images at high resolution to thumbnails in matter of milliseconds.

## Installation

`npm i -S express-image-render`

Prior to install ensure you should have installed and configured [sharp](https://sharp.pixelplumbing.com/install) according to your system

On your express main file:

```javascript
const imageRender = require("express-image-render");
//====================================================================
// ### ADD YOUR IMAGE RENDERING DIRECTORIES
//====================================================================
const imageOpts = {
  quality: 100, // 60 (default), added in v1.0.2 this allows image render quality output control min 1 max 100
};
app.use("/path/to/site/images", imageRender(imageOpts));
app.use("/path/to/another/folder/of/images", imageRender);
```

## Usage

On your Front-end you can call your images adding the following image params:

```json
    width: image output width in px
    height: image output in px
    format: will process the image to a specified format. jpeg, jpg, png, webp, gif, tiff, avif, heif, raw, tile, bmp
    crop: "cover" (default), contain, fill, inside, outside. Note: `cover and contain will center image`
```

**Note**: All GET requests to images and all operations will either read the default values or process the params if any present in the request.

Example:

```html
<img
  src="/path/to/my/image/image.jpg?width=1000&height=800&format=webp&crop=cover"
/>
```

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