Security News
Research
Supply Chain Attack on Rspack npm Packages Injects Cryptojacking Malware
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
bianco.images-loader
Advanced tools
Modern images loader helpers written in es2015 using generators and promises
Modern images loader helpers written in es2015 using promises
import { loadImage } from 'bianco.images-loader'
loadImage('path/to/the/image.jpg').then(img => document.body.appendChild(img))
Or also DOM nodes:
import $ from 'bianco.query'
import { loadImage } from 'bianco.images-loader'
loadImage($('img.cool'))
.then(img => img.classList.add('loaded'))
.catch(function(error) {
// there was an error loading the image
})
import { loadImages } from 'bianco.images-loader'
loadImages([
'path/to/the/image1.jpg',
'path/to/the/image2.jpg'
])
.then(imgs => imgs.forEach(i => document.body.appendChild(i)))
.catch(error => {
// there was an error loading one of images
})
Or also...
import $ from 'bianco.query'
import { loadImages } from 'bianco.images-loader'
loadImages($('img', '.main-content'))
.then(imgs => imgs.forEach(i => i.classList.add('loaded')))
.catch(error => {
// there was an error loading one of images
})
Preload any image
img
(string | HTMLElement) Path to the image or image objectReturns Promise a promise that will be resolved when the image will be completely loaded
Load in parallel a collection of images
Returns Promise a promise that will be resolved when all the images will be loaded
FAQs
Modern images loader helpers written in es2015 using generators and promises
We found that bianco.images-loader demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.
Security News
Sonar’s acquisition of Tidelift highlights a growing industry shift toward sustainable open source funding, addressing maintainer burnout and critical software dependencies.