Safely move files and directories to trash on Linux
$ cnpm install xdg-trash
Safely move files and directories to trash on Linux
$ npm install --save xdg-trash
const xdgTrash = require('xdg-trash');
xdgTrash(['foo.txt', 'bar.tar']).then(() => {
console.log('Files successfully moved to trash!');
});
Move files to trash. Returns a promise that resolves to an array containing the removed files.
Required
Type: array
Files to be moved to trash.
See the trash CLI.
MIT © Kevin Mårtensson
Copyright 2013 - present © cnpmjs.org | Home |