# adamdbradley/foresight.js

DEPRECATED: Prior to recent developments with the picture element, Foresight.js gaves webpages the ability to tell if the user's device is capable of viewing high-resolution images before the image is requested from the server. Additionally, it judges if the user's device currently has a fast enough network connection for high-resolution images. Depending on device display and network connectivity, foresight.js will request the appropriate image for the webpage.

Repository: https://github.com/adamdbradley/foresight.js
Canonical: https://ross.abutalabs.com/products/foresightjs
Language: JavaScript
License: MIT
License Family: permissive
Last push: 2014-09-10T19:54:15+00:00

## Health v2 (maintenance only)
Score: 32/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 35, longevity 100
- inputs: {"age_days": 5286, "days_push": 4375, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2228, forks 89 (observed 2026-08-28T04:06:28.901016+00:00)

## What it is
Foresight.js is a JavaScript library that detects whether a user's device has a high-resolution display and a fast enough network connection before requesting images, then loads the appropriate image variant. It is now deprecated in favor of the native HTML picture element and polyfills like picturefill.

## Use cases
- serve retina images only to devices that support them
- avoid wasting bandwidth on slow network connections
- detect device pixel ratio before requesting images
- manage hi-res image variants across a site from one config
- estimate network connection speed in the browser

## When to choose
- maintaining a legacy codebase that already uses foresight.js
- supporting very old browsers that lack the picture element and cannot use picturefill

## When to avoid
- starting any new project - it is deprecated
- modern browsers that support the native picture element and srcset
- projects where picturefill or native responsive images suffice

## Facets
- artifact type: library
- maturity: abandoned
- function: image-processing, http-client
- domain: web-development, frontend, image-processing, performance
- platform: browser
- tags: responsive-images, retina, deprecated, network-detection, device-pixel-ratio, image-set, javascript

## Member repositories
- adamdbradley/foresight.js (main) score 32

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:28.901016+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T02:44:42.111124+00:00, confidence not recorded.
  - readme: https://github.com/adamdbradley/foresight.js (fetched 2026-08-28T04:06:28.901016+00:00, sha 565fd1c1b9e4)
- Data as of 2026-08-30T08:39:29.467469+00:00.
