trash alternatives and similar modules
Based on the "Command Line Apps" category.
Alternatively, view trash alternatives based on common mentions on social networks and blogs.
-
ignite
Infinite Red's battle-tested React Native project boilerplate, along with a CLI, component/model generators, and more! 9 years of continuous development and counting. -
David
:eyeglasses: Node.js module that tells you when your package npm dependencies are out of date. -
Whatspup
:white_square_button: WhatsApp chat from commandline/console/cli using GoogleChrome puppeteer -
tty-table
Terminal table for Windows, Linux, and MacOS. Written in nodejs. Also works in browser console. Word wrap, padding, alignment, colors, Asian character support, per-column callbacks, and you can pass rows as objects or arrays. Backwards compatible with Automattic/cli-table.
SaaSHub - Software Alternatives and Reviews
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of trash or a related project?
Popular Comparisons
README
[trash](media/logo.png)
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.
Install
npm install trash
Usage
import trash from 'trash';
await trash(['*.png', '!rainbow.png']);
API
trash(input, options?)
Returns a Promise
.
input
Type: string | string[]
Accepts paths and glob patterns.
options
Type: object
glob
Type: boolean
\
Default: true
Enable globbing when matching file paths.
CLI
To install the trash
command, run:
$ npm install --global trash-cli
Info
On macOS, macos-trash
is used.\
On Linux, the XDG spec is followed.\
On Windows, recycle-bin
is used.
FAQ
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.
Related
- trash-cli - CLI for this module
- empty-trash - Empty the trash
- del - Delete files and folders