

Trash
1 like
Move files and directories to the trash.
Cost / License
- Free
- Open Source
Platforms
- Mac
- Windows
- Linux
Features
- Command line interface
Tags
- move-to-trash
- delete-files
- delete-directories
Trash News & Activities
Highlights All activities
Recent activities
No activities found.
Trash information
No comments or reviews, maybe you want to be first?
Post comment/reviewWhat is Trash?
Works on macOS, Linux, and Windows.
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.
But I can do the same thing with 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.


