# soulwire/fit.js

Fit things into other things

Repository: https://github.com/soulwire/fit.js
Canonical: https://ross.abutalabs.com/products/fitjs
Language: JavaScript
License: WTFPL
License Family: permissive
Last push: 2017-10-25T08:15:52+00:00

## Health v2 (maintenance only)
Score: 32/100 (v2, computed 2026-09-03T02:39:23.370411+00:00)
- activity 0, release rhythm 35, longevity 100
- inputs: {"age_days": 4610, "days_push": 3234, "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 1881, forks 102 (observed 2026-08-28T04:05:48.631063+00:00)

## What it is
Fit.js is a tiny JavaScript library that scales and aligns one rectangular object (DOM element or plain rect) to fit inside another while preserving aspect ratio. It supports cover/contain modes, alignment options, resize watching, and custom transform callbacks.

## Use cases
- fit a video or image inside a container while keeping aspect ratio
- scale text to fill its parent element
- implement cover/contain behavior like CSS object-fit with alignment control
- refit elements automatically on window resize
- fit arbitrary rectangle objects in canvas or game layouts

## When to avoid
- you need modern CSS object-fit which covers most DOM cases
- you need responsive layout systems or grid frameworks
- the project needs actively maintained dependencies

## Facets
- artifact type: library
- maturity: maintenance
- function: ui-components, graphics
- domain: web-development, frontend
- platform: browser
- tags: aspect-ratio, dom-layout, scaling, cover-contain, micro-library, javascript

## Member repositories
- soulwire/fit.js (main) score 32

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:48.631063+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-30T03:13:59.217015+00:00, confidence not recorded.
  - readme: https://github.com/soulwire/fit.js (fetched 2026-08-28T04:05:48.631063+00:00, sha 3249ba772f30)
- Data as of 2026-08-30T08:39:29.467469+00:00.
