$ gnpm install xdg-trashdir
Get the correct trash path on Linux according to the spec
$ npm install xdg-trashdir
const xdgTrashdir = require('xdg-trashdir');
(async () => {
console.log(await xdgTrashdir());
//=> '/home/johndoe/.local/share/Trash'
console.log(await xdgTrashdir('foo.zip'));
//=> '/media/johndoe/UUI/.Trash-1000'
console.log(await xdgTrashdir.all());
//=> ['/home/johndoe/.local/share/Trash', '/media/johndoe/UUI/.Trash-1000', …]
})();
Returns a Promise<string>
with the path to the trash.
Type: string
Get the trash path for a specific file.
Returns a Promise<string[]>
with all possible trash paths.
Copyright 2013 - present © cnpmjs.org | Home |