2.1.3 • Published 7 years ago

xdg-trashdir-fixed v2.1.3

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

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