# image-preview-js

> JavaScript module to preview images.

Latest version **1.0.1** (published 2018-08-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install image-preview-js
pnpm add image-preview-js
yarn add image-preview-js
bun add image-preview-js
```

## 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.1 |
| Published | 2018-08-29 |
| First published | 2018-08-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 42.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Fenyr |
| Maintainers | fenyr-sh |
| Keywords | image, preview, js, javascript |

## Links

- npm: https://www.npmjs.com/package/image-preview-js
- Repository: https://github.com/fenyr-sh/image-preview-js
- Homepage: https://github.com/fenyr-sh/image-preview-js#readme
- Issues: https://github.com/fenyr-sh/image-preview-js/issues
- npm.io page: https://npm.io/package/image-preview-js

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.0.1 (latest) — 2018-08-29
- 1.0.0 — 2018-08-29

## README

# Image Preview JS

Image Preview JS is a JavaScript module to preview images.

## Installation

Download or clone the repository.

~~~git
git clone https://github.com/fenyr-sh/image-preview-js.git
~~~

You can also download it using npm.

~~~npm
npm i image-preview-js
~~~

## Usage

Add the **dist/js/app.js** file to your site.

~~~html
<script src="dist/js/app.js"></script>
~~~

Optionally you can include the stylesheet **dist/css/app.css**.

~~~html
<link rel="stylesheet" href="dist/css/app.css">
~~~

### Example

The input must contain a `preview` attribute where the value of the attribute must
be equal to the `id` of the container where the images will be displayed.

~~~html
<!-- Image Preview -->
<div class="custom-preview" style="width: 300px">
    <label class="custom-preview-label" for="">Image Preview</label>
    <input class="custom-preview-input" type="file" name="" id="" preview="image-preview">
</div>

<div class="preview" id="image-preview"></div>

<!-- Image Preview 2 -->
<div class="custom-preview" style="width: 300px">
    <label class="custom-preview-label" for="">Image Preview 2</label>
    <input class="custom-preview-input" type="file" name="" id="" preview="image-preview2">
</div>

<div class="preview" id="image-preview2"></div>
~~~

## Screenshot

![Alternate text](assets/images/image-preview.png)

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