# legendary-image-preview

> A package that receives an event and is able to allow preview the image uploaded as a file

Latest version **1.0.7** (published 2022-10-25) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.0.7 |
| Published | 2022-10-25 |
| First published | 2022-10-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 1.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 7 |
| Author | Zesta |
| Maintainers | hallcoder |
| Keywords | image, preview |

## Links

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

## 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.7 (latest) — 2022-10-25
- 1.0.6 — 2022-10-25
- 1.0.5 — 2022-10-25
- 1.0.4 — 2022-10-25
- 1.0.3 — 2022-10-22
- 1.0.2 — 2022-10-22

## README

# image-preview-npm
An image preview package published live on npm 

# install
 ```
 npm i image-preview-npm
 ```
 
# Initialize the image object
```javascript
   import Image from 'legendary-image-preview';

 
   //use the image's getBase64Image function in your handler to get the base64 image and set it as the source of the img tag like so:\
   function ImagePreview(){
    const  [imageSource,setImageSource] = useState('');
    const  handleChange = (e) => {
    let image  = new Image(e.target.files);
    setImageSource(image.getBase64Image());
 }
 return(
 <div>
      <input onChange={handleChange} type='file'/>
      <img src={image} alt='preview' />
     </div>
 )
 }
 export default ImagePreview;
 ```

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