https://github.com/erhangundogan/image-helpers
Tiny typescript library to fetch multiple images
https://github.com/erhangundogan/image-helpers
image-fetch image-loader image-loading image-loading-library
Last synced: about 1 month ago
JSON representation
Tiny typescript library to fetch multiple images
- Host: GitHub
- URL: https://github.com/erhangundogan/image-helpers
- Owner: erhangundogan
- License: mit
- Created: 2021-04-11T19:58:33.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2023-04-20T09:18:17.000Z (almost 3 years ago)
- Last Synced: 2025-10-14T10:27:33.549Z (5 months ago)
- Topics: image-fetch, image-loader, image-loading, image-loading-library
- Language: TypeScript
- Homepage:
- Size: 979 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
image-helpers
=============
[![License][license-src]][license-href]
Helper methods to receive and create HTMLImageElements
# Methods
## fetchImages
```typescript
export interface FetchImagesOptionsPropsType {
tryCors?: boolean;
failEarly?: boolean;
}
export interface FetchImagesCorsOptionsPropsType {
generateHash?: boolean;
fetchOptions?: RequestInit;
}
const fetchImages = async (
imageUrls: string[] = [],
options: FetchImagesOptionsPropsType = { tryCors: false, failEarly: false },
corsOptions: FetchImagesCorsOptionsPropsType = { generateHash: false, fetchOptions: { cache: 'force-cache' } }
): Promise> => {}
```
## verifyUrls
```typescript
export interface VerifyUrlsPropsType {
maxFileSize?: number;
ignoreRequestErrors?: boolean;
testUrls?: boolean;
requiredOrigin?: string | undefined;
}
const verifyUrls = async (urls: Array, options: VerifyUrlsPropsType = {}): Promise> => {}
```
# Install
```bash
npm install image-helpers
```
# Development
```bash
git clone git@github.com:erhangundogan/image-helpers.git
cd image-helpers
npm i
npm run build
npm run test
```
[license-src]: https://img.shields.io/badge/license-MIT-brightgreen.svg
[license-href]: LICENSE.md