https://github.com/wobsoriano/bun-plugin-thumbhash
ThumbHash plugin for Bun
https://github.com/wobsoriano/bun-plugin-thumbhash
Last synced: 11 days ago
JSON representation
ThumbHash plugin for Bun
- Host: GitHub
- URL: https://github.com/wobsoriano/bun-plugin-thumbhash
- Owner: wobsoriano
- License: mit
- Created: 2023-07-31T00:28:02.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-09-13T19:18:05.000Z (about 2 years ago)
- Last Synced: 2025-04-15T02:17:57.386Z (6 months ago)
- Language: TypeScript
- Homepage:
- Size: 72.3 KB
- Stars: 8
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
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 thumbhash from 'bun-plugin-thumbhash'Bun.plugin(thumbhash())
``````tsx
import Image from './example.png?thumb'export function App() {
const [isLoading] = useState(false)
return (
{ isLoading
?![]()
:![]()
}
)
}
```## TypeScript Shim
Add the following to your `.d.ts` file:
```ts
///
```## License
MIT