# bun-plugin-thumbhash

> ThumbHash plugin for Bun.

Latest version **0.1.5** (published 2023-09-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install bun-plugin-thumbhash
pnpm add bun-plugin-thumbhash
yarn add bun-plugin-thumbhash
bun add bun-plugin-thumbhash
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.5 |
| Published | 2023-09-13 |
| First published | 2023-07-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 4.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 8 |
| Author | Robert Soriano |
| Maintainers | wobsoriano |
| Keywords | bun |

## Links

- npm: https://www.npmjs.com/package/bun-plugin-thumbhash
- Repository: https://github.com/wobsoriano/bun-plugin-thumbhash
- Homepage: https://github.com/wobsoriano/bun-plugin-thumbhash#readme
- Issues: https://github.com/wobsoriano/bun-plugin-thumbhash/issues
- npm.io page: https://npm.io/package/bun-plugin-thumbhash

## Dependencies (2)

- [thumbhash](https://npm.io/package/thumbhash.md) ^0.1.1
- [@napi-rs/canvas](https://npm.io/package/@napi-rs/canvas.md) ^0.1.44

## Alternatives

- [raw-loader](https://npm.io/package/raw-loader.md) — 4.3M weekly downloads
- [plop](https://npm.io/package/plop.md) — 1.4M weekly downloads
- [webpack-deadcode-plugin](https://npm.io/package/webpack-deadcode-plugin.md) — 80.3K weekly downloads
- [@storybook/preact-vite](https://npm.io/package/@storybook/preact-vite.md) — 54.2K weekly downloads
- [vite-plugin-transform](https://npm.io/package/vite-plugin-transform.md) — 2.4K weekly downloads

## Recent versions

- 0.1.5 (latest) — 2023-09-13
- 0.1.4 — 2023-08-06
- 0.1.3 — 2023-08-02
- 0.1.2 — 2023-08-01
- 0.1.1 — 2023-08-01
- 0.1.0 — 2023-08-01
- 0.0.2 — 2023-07-31
- 0.0.1 — 2023-07-31

## README

# bun-plugin-thumbhash



https://github.com/wobsoriano/bun-plugin-thumbhash/assets/13049130/3cbf35ce-d7cb-495e-93fc-77816e32dbf9



[ThumbHash](https://github.com/evanw/thumbhash) plugin for Bun.

A very compact representation of a placeholder for an image. Store it inline with your data and show it while the real image is loading for a smoother loading experience.

## Install

```bash
bun install bun-plugin-thumbhash
```

## Usage

```ts
import { plugin } from 'bun'
import thumbhash from 'bun-plugin-thumbhash'

plugin(thumbhash())
```

```tsx
import Image from './example.png?thumb'

export function App() {
  const [isLoading] = useState(false)
  return (
    <>
      { isLoading 
        ? <img src={Image.src} width={Image.width} height={Image.height} />
        : <img src={Image.originalSrc} width={Image.originalWidth} height={Image.originalHeight} />
      }
    </>
  )
}
```

## TypeScript Shim

Add the following to your `.d.ts` file:

```ts
/// <reference types="bun-plugin-thumbhash/client" />
```

## License

MIT

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