xdg-trashdir
TypeScript icon, indicating that this package has built-in type declarations

3.1.0 • Public • Published

xdg-trashdir Build Status

Get the correct trash path on Linux according to the spec

Install

$ npm install xdg-trashdir

Usage

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', …]
})();

API

xdgTrashdir(file?)

Returns a Promise<string> with the path to the trash.

file

Type: string

Get the trash path for a specific file.

xdgTrashdir.all()

Returns a Promise<string[]> with all possible trash paths.

Package Sidebar

Install

npm i xdg-trashdir

Weekly Downloads

64,743

Version

3.1.0

License

MIT

Unpacked Size

5.21 kB

Total Files

5

Last publish

Collaborators

  • kevva
  • sindresorhus