image-helpers
v1.3.0
Published
Helper methods to receive and create HTMLImageElement(s)
Downloads
499
Readme
image-helpers
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 [email protected]:erhangundogan/image-helpers.git
cd image-helpers
npm i
npm run build
npm run test