# avoidwork/filesize.js

A lightweight, high-performance file size utility that converts bytes to human-readable strings. Zero dependencies. 100% test coverage.

Repository: https://github.com/avoidwork/filesize.js
Canonical: https://ross.abutalabs.com/products/filesizejs
Homepage: https://filesizejs.com
Language: JavaScript
License: BSD-3-Clause
License Family: permissive
Topics: filesize, file, filesystem, size, size-calculation, jedec, iec, bits, bytes, simple
Last push: 2026-08-24T05:20:17+00:00

## Health v2 (maintenance only)
Score: 77/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 99, release rhythm 35, longevity 100
- inputs: {"age_days": 5297, "days_push": 9, "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 1708, forks 102 (observed 2026-08-28T04:05:25.460340+00:00)

## What it is
filesize.js is a lightweight, zero-dependency JavaScript library that converts byte counts into human-readable strings. It supports SI, IEC, and JEDEC unit standards, bits, BigInt, localization via the Intl API, and works in both browsers and Node.js.

## Use cases
- format file sizes in bytes as human-readable strings
- display 1024 as 1 KiB using IEC standard
- convert bytes to kilobits for bandwidth display
- create reusable file size formatters with partial application
- format file sizes with locale-aware number formatting
- handle extremely large file sizes with BigInt
- get file size as structured object instead of string

## When to choose
- you need reliable, dependency-free byte-to-human-readable conversion in JavaScript or TypeScript
- you need support for multiple unit standards (SI, IEC, JEDEC) or bits
- you need a tiny utility that works in browser, Node.js, and with BigInt values

## When to avoid
- you need actual file system operations like reading or measuring files on disk
- your project is not JavaScript/TypeScript based
- you need formatting of units other than data sizes (e.g., durations, weights)

## Facets
- artifact type: library
- maturity: stable
- function: serialization, developer-tools
- domain: developer-tools, files, web-development
- platform: browser, cross-platform
- tags: filesize, bytes, human-readable, zero-dependency, typescript, bigint, formatting, nodejs

## Member repositories
- avoidwork/filesize.js (main) score 77

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:25.460340+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:37:00.317587+00:00, confidence not recorded.
  - readme: https://github.com/avoidwork/filesize.js (fetched 2026-08-28T04:05:25.460340+00:00, sha 0403561341f9)
  - homepage: https://filesizejs.com (fetched 2026-08-29T11:11:39.067547+00:00, sha 9d6f88f33955)
- Data as of 2026-08-30T08:39:29.467469+00:00.
