JSPM

xdg-trashdir-fixed

2.1.3
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q18876F
  • License MIT

Get the correct trash path on Linux

Package Exports

  • xdg-trashdir-fixed

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (xdg-trashdir-fixed) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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