Gathering detailed insights and metrics for trash
Gathering detailed insights and metrics for trash
Gathering detailed insights and metrics for trash
Gathering detailed insights and metrics for trash
npm install trash
Typescript
Module System
Min. Node Version
Node Version
NPM Version
95.9
Supply Chain
89
Quality
74.5
Maintenance
100
Vulnerability
98.6
License
JavaScript (97.29%)
TypeScript (2.71%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
2,591 Stars
156 Commits
80 Forks
25 Watchers
1 Branches
24 Contributors
Updated on Jul 02, 2025
Latest Version
9.0.0
Package Id
trash@9.0.0
Unpacked Size
218.46 kB
Size
59.41 kB
File Count
11
NPM Version
10.6.0
Node Version
18.20.2
Published on
Jul 26, 2024
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
5
Move files and folders to the trash
Works on macOS (10.12+), Linux, and Windows (8+).
Note: The Linux implementation is not very good and not maintained. Help welcome. If no one steps up to help maintain it, I will eventually remove Linux support.
In contrast to fs.unlink
, del
, and rimraf
which permanently delete files, this only moves them to the trash, which is much safer and reversible.
1npm install trash
1import trash from 'trash'; 2 3await trash(['*.png', '!rainbow.png']);
Returns a Promise
.
Type: string | string[]
Accepts paths and glob patterns.
Type: object
Type: boolean
Default: true
Enable globbing when matching file paths.
To install the trash
command, run:
1npm install --global trash-cli
On macOS, macos-trash
is used.
On Linux, the XDG spec is followed.
On Windows, recycle-bin
is used.
mv
Not really. The mv
command isn't cross-platform and moving to trash is not just about moving the file to a "trash" directory. On all OSes you'll run into file conflicts. The user won't easily be able to restore the file. It won't work on an external drive. The trash directory location varies between Windows versions. For Linux, there's a whole spec you need to follow. On macOS, you'll lose the Put back feature.
No vulnerabilities found.
Reason
security policy file detected
Details
Reason
no dangerous workflow patterns detected
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
binaries present in source code
Details
Reason
Found 11/30 approved changesets -- score normalized to 3
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More