# alexei/sprintf.js

sprintf.js is a complete open source JavaScript sprintf implementation

Repository: https://github.com/alexei/sprintf.js
Canonical: https://ross.abutalabs.com/products/sprintfjs
Language: JavaScript
License: BSD-3-Clause
License Family: permissive
Topics: sprintf, javascript
Last push: 2024-04-05T01:22:42+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": 4901, "days_push": 881, "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 2139, forks 283 (observed 2026-08-28T04:06:18.231510+00:00)

## What it is
sprintf.js is a complete open source JavaScript implementation of the classic sprintf string formatting function, usable in both the browser and Node.js. It supports argument indexing, padding, alignment, precision, and other printf-style format specifiers via sprintf and vsprintf APIs.

## Use cases
- format strings with printf-style placeholders in javascript
- sprintf implementation for node.js
- format numbers with padding and precision in the browser
- interpolate arguments into a format string by position
- vsprintf formatting from an array of arguments

## When to choose
- you need C-style sprintf formatting in JavaScript
- you want a small, dependency-free formatting library for browser or Node.js
- you need argument swapping, padding, alignment, or precision specifiers

## When to avoid
- you only need simple template literals or string interpolation
- you need locale-aware number or date formatting (use Intl instead)
- you target very old environments without polyfills

## Facets
- artifact type: library
- maturity: stable
- function: serialization, developer-tools
- domain: developer-tools, web-development, frontend
- platform: browser, cross-platform
- tags: string-formatting, sprintf, printf, formatting, javascript, nodejs

## Member repositories
- alexei/sprintf.js (main) score 32

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:18.231510+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:51:30.480353+00:00, confidence not recorded.
  - readme: https://github.com/alexei/sprintf.js (fetched 2026-08-28T04:06:18.231510+00:00, sha b4473d59f084)
- Data as of 2026-08-30T08:39:29.467469+00:00.
