
Security News
US Government Forces Anthropic to Pull Claude Fable Days After Launch
Anthropic says the directive cited national security concerns over a narrow jailbreak, but offered no specific technical details.
tw-image-metrics
Advanced tools
Scrapes a page to gather performance metrics about loaded images.
You must pass a valid window object for the page you wish to scrape.
var imageMetrics = require('tw-image-metrics');
var data = imageMetrics(window);
Optionally, you can also pass an array of filetypes to filter by.
var pngsOnly = imageMetrics(window, ['png']);
tw-image-metrics returns an array of objects with performance data for each image.
[{
url: "https://foo.bar/image.png",
type: "png",
size: 123.45,
loadTime: 250,
width: 1024,
height: 768,
from: "css"
}]
url: the full URL of the image.
type: The filetype of the image.
size: The filesize of the image (in kilobytes).
loadTime: The time it took to load the image (in milliseconds).
width: The width of the image (in pixels).
height: The height of the image (in pixels).
from: The source of the image. Typically, this is img for images loaded from HTML, and css for images loaded from CSS.
tw-image-metrics may return 0 for the size property if the image is loaded from the cache. Make sure your cache is clear before calling this function.
FAQs
Scrapes a page to gather performance metrics about loaded images.
We found that tw-image-metrics 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.

Security News
Anthropic says the directive cited national security concerns over a narrow jailbreak, but offered no specific technical details.

Security News
A network of 152 Chrome live wallpaper extensions hid ad tracking and made extension-driven traffic look like Google search clicks.

Company News
Socket’s first CISO brings deep experience securing high-growth SaaS companies as open source supply chain threats accelerate.