Safely move files and directories to trash on Linux
Install
$ npm install --save xdg-trash
Usage
const xdgTrash = require('xdg-trash');
xdgTrash(['foo.txt', 'bar.tar']).then(() => {
console.log('Files successfully moved to trash!');
});
API
xdgTrash(files)
Move files to trash. Returns a promise that resolves to an array containing the removed files.files
RequiredType:
array
Files to be moved to trash.