xdg-trashdir
Get the correct trash path on Linux
Last updated 10 years ago by kevva .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install xdg-trashdir 
SYNC missed versions from official npm registry.

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.

Current Tags

  • 3.1.0                                ...           latest (5 years ago)

11 Versions

  • 3.1.0                                ...           5 years ago
  • 3.0.0                                ...           5 years ago
  • 2.1.0                                ...           9 years ago
  • 2.1.1                                ...           7 years ago
  • 2.0.0                                ...           9 years ago
  • 1.1.1                                ...           10 years ago
  • 1.1.0                                ...           10 years ago
  • 1.0.3                                ...           10 years ago
  • 1.0.2                                ...           10 years ago
  • 1.0.1                                ...           10 years ago
  • 1.0.0                                ...           10 years ago
Maintainers (2)
Downloads
Today 1
This Week 1
This Month 35
Last Day 0
Last Week 0
Last Month 0
Dependencies (3)
Dev Dependencies (1)
Dependents (2)

Copyright 2013 - present © cnpmjs.org | Home |