🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

async-preload-img

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

async-preload-img

Promise based image preloader

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

async-preload-img

Promise based image preloader

Installation

npm install --save async-preload-img

Usage

async/await

import preloadImg from 'async-preload-img'

try {
  await preloadImg('https://image-path.com')
  // Image loaded
} catch (error) {
  // Failed to load image
}

Promise

import preloadImg from 'async-preload-img'

preloadImg('https://image-path.com')
  .then(() => {
    // Image loaded
  })
  .catch(() => {
    // Failed to load image
  })

Sponsor

If you found this library useful and are willing to donate, transfer some bitcoins to 1BqqKiZA8Tq43CdukdBEwCdDD42jxuX9UY.

caiogondim.com  ¡  GitHub @caiogondim  ¡  Twitter @caio_gondim

FAQs

Package last updated on 14 Nov 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts