# sindresorhus/trash

Move files and directories to the trash

Repository: https://github.com/sindresorhus/trash
Canonical: https://ross.abutalabs.com/products/trash
Language: JavaScript
License: MIT
License Family: permissive
Topics: trash, recycle-bin, delete, nodejs, npm-package
Last push: 2026-02-25T14:51:56+00:00

## Health v2 (maintenance only)
Score: 72/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 69, release rhythm 60, longevity 100
- inputs: {"age_days": 4494, "days_push": 189, "days_rel": 189, "gap_med": 48, "n_releases_24m": 4}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2665, forks 81 (observed 2026-08-28T04:07:09.116637+00:00)

## What it is
A Node.js library that safely moves files and directories to the OS trash/recycle bin instead of permanently deleting them, with glob pattern support. It works cross-platform on macOS, Windows, and Linux (XDG spec).

## Use cases
- safely delete files to trash instead of rm
- move files to recycle bin from nodejs
- reversible file deletion in a script
- delete files with glob patterns to trash
- cross-platform trash support in a node app

## When to choose
- you want deletions to be recoverable via the OS trash
- you need cross-platform safe file removal in Node.js
- you want glob-based file matching before trashing

## When to avoid
- you need permanent, irreversible deletion (use del or rimraf)
- you need robust Linux support, which is poorly maintained
- you're running as a Windows service account where recycle bin behavior is problematic

## Facets
- artifact type: library
- maturity: active
- function: file-system, cli
- domain: files, developer-tools, cross-platform
- platform: windows, cli
- tags: trash, recycle-bin, safe-delete, glob, npm-package, nodejs, macos, linux

## Member repositories
- sindresorhus/trash (main) score 72

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:07:09.116637+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:18:17.966191+00:00, confidence not recorded.
  - readme: https://github.com/sindresorhus/trash (fetched 2026-08-28T04:07:09.116637+00:00, sha c8d7a80092d8)
  - registry_npm: https://registry.npmjs.org/trash (fetched 2026-08-29T10:01:15.403043+00:00, sha 888b68337529)
- Data as of 2026-08-30T08:39:29.467469+00:00.
