Skip to content

erhangundogan/image-helpers

Repository files navigation

image-helpers

License

Helper methods to receive and create HTMLImageElements

Methods

fetchImages

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<Array<ImageType>> => {}

verifyUrls

export interface VerifyUrlsPropsType {
  maxFileSize?: number;
  ignoreRequestErrors?: boolean;
  testUrls?: boolean;
  requiredOrigin?: string | undefined;
}
const verifyUrls = async (urls: Array<string>, options: VerifyUrlsPropsType = {}): Promise<Array<string>> => {}

Install

npm install image-helpers

Development

git clone git@github.com:erhangundogan/image-helpers.git
cd image-helpers
npm i
npm run build
npm run test

About

Tiny typescript library to fetch multiple images

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy