
Research
/Security News
Weaponizing Discord for Command and Control Across npm, PyPI, and RubyGems.org
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Lazy load images
Requires derby-stylus
to support styles.
Create images.assets.js
file with datauri images. Use datauri
module for it:
// File must be named *.assets.js
var datauri = require('datauri');
module.exports = {
// Logo (full versions to be used with dataimg)
'/img/logo_blue.svg': datauri(
__dirname + '/../public/img/logo_blue.svg'),
'/img/logo_white.svg': datauri(
__dirname + '/../public/img/logo_white.svg'),
// Backgrounds (we specify minified versions to be used with lazyimg)
'/img/cloudy-hills.jpg': datauri(
__dirname + '/../public/img/cloudy-hills.min.jpg'),
'/img/bg_strings.jpg': datauri(
__dirname + '/../public/img/bg_strings.min.jpg'),
};
Plug in d-lazyimg
module and provide datauri assets as an option:
app.use(require('d-lazyimg'), require('./images.assets'));
Use lazyimg
component to do lazy loading of big image:
<lazyimg img='/img/cloudy-hills.jpg'>
It will instantly load the small image cloudy-hills.min.jpg
you specified in the assets as datauri. Right after that it will start the regular asynchronous loading of the heavy cloudy-hills.jpg
. When full image finish loading it will transparently switch itself with the minified version.
Image caching is not affected - if the full image is already in the browser's cache it won't try to load it the second time the server.
Use dataimg
to embed the full image as datauri:
<dataimg img='/img/logo_blue.svg'>
FAQs
Lazy load images plugin for derby.js
We found that d-lazyimg demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.