image-helpers
TypeScript icon, indicating that this package has built-in type declarations

1.3.0 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i image-helpers

Weekly Downloads

56

Version

1.3.0

License

MIT

Unpacked Size

103 kB

Total Files

7

Last publish

Collaborators

  • erhangundogan