xdg-trashdir-fixed

2.1.3 • Public • Published

xdg-trashdir Build Status

Get the correct trash path on Linux according to the spec

Install

$ npm install --save xdg-trashdir

Usage

const xdgTrashdir = require('xdg-trashdir');
 
xdgTrashdir().then(dir => {
    console.log(dir);
    //=> '/home/johndoe/.local/share/Trash'
});
 
xdgTrashdir('foo.zip').then(dir => {
    console.log(dir);
    //=> '/media/johndoe/UUI/.Trash-1000'
});
 
xdgTrashdir.all().then(dirs => {
    console.log(dirs);
    //=> ['/home/johndoe/.local/share/Trash', '/media/johndoe/UUI/.Trash-1000', ...]
});

API

xdgTrashdir([file])

Returns a promise that resolves the path to the trash.

file

Type: string

Get the trash path for a specific file.

xdgTrashdir.all()

Returns a promise that resolves to an array with all possible trash paths.

License

MIT © Kevin Mårtensson

Package Sidebar

Install

npm i xdg-trashdir-fixed

Weekly Downloads

0

Version

2.1.3

License

MIT

Last publish

Collaborators

  • john-berlin