# dollarshaveclub/shave

💈 Shave is a 0 dep JS plugin that truncates text to fit within an element based on a set max-height  ✁

Repository: https://github.com/dollarshaveclub/shave
Canonical: https://ross.abutalabs.com/products/shave
Homepage: https://github.com/yowainwright/shave
Language: JavaScript
License: MIT
License Family: permissive
Topics: truncate, ellipsis, multi-line
Archived: true
Last push: 2020-10-27T20:20:25+00:00

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

## Adoption (not part of the score)
Stars 2086, forks 122 (observed 2026-08-28T04:06:11.972177+00:00)

## What it is
Shave is a zero-dependency JavaScript plugin that truncates multi-line text to fit within an HTML element based on a max-height, adding an ellipsis while preserving the original text in a hidden span. This original repository has moved to yowainwright/shave and is maintained there.

## Use cases
- truncate multi-line text with an ellipsis in the browser
- clamp text to a max height without CSS line-clamp support
- preserve original text after truncating a headline or card description
- truncate text in many DOM elements quickly
- add custom ellipsis strings to truncated text
- truncate text for non-space-separated languages

## When to choose
- you need lightweight, dependency-free multi-line text truncation
- you want the original text preserved after truncation
- you need jQuery/Zepto-compatible truncation or module usage

## When to avoid
- you can use native CSS line-clamp instead
- you need a maintained repo - use yowainwright/shave instead of this archived location
- you need server-side or non-DOM text truncation

## Facets
- artifact type: plugin
- maturity: maintenance
- function: ui-components, frontend-framework
- domain: frontend, web-development
- platform: browser
- tags: text-truncation, ellipsis, multi-line, zero-dependency, javascript-plugin, nodejs

## Member repositories
- dollarshaveclub/shave (main) score 10

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:11.972177+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:55:48.118828+00:00, confidence not recorded.
  - readme: https://github.com/dollarshaveclub/shave (fetched 2026-08-28T04:06:11.972177+00:00, sha 7eb412be506b)
  - homepage: https://github.com/yowainwright/shave (fetched 2026-08-29T10:36:01.769078+00:00, sha b0b5268b5702)
- Data as of 2026-08-30T08:39:29.467469+00:00.
