# xdg-trashdir

> Get the correct trash path on Linux

Latest version **3.1.0** (published 2019-09-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install xdg-trashdir
pnpm add xdg-trashdir
yarn add xdg-trashdir
bun add xdg-trashdir
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.1.0 |
| Published | 2019-09-07 |
| First published | 2014-10-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=10 |
| Dependencies | 4 |
| Unpacked size | 5.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 12 |
| Author | Kevin Mårtensson |
| Maintainers | kevva, sindresorhus |
| Keywords | dir, file, linux, recycle, trash, xdg |

## Links

- npm: https://www.npmjs.com/package/xdg-trashdir
- Repository: https://github.com/kevva/xdg-trashdir
- Homepage: https://github.com/kevva/xdg-trashdir#readme
- Issues: https://github.com/kevva/xdg-trashdir/issues
- npm.io page: https://npm.io/package/xdg-trashdir

## Dependencies (4)

- [user-home](https://npm.io/package/user-home.md) ^2.0.0
- [mount-point](https://npm.io/package/mount-point.md) ^3.0.0
- [xdg-basedir](https://npm.io/package/xdg-basedir.md) ^4.0.0
- [@sindresorhus/df](https://npm.io/package/@sindresorhus/df.md) ^3.1.1

## Alternatives

- [unionfs](https://npm.io/package/unionfs.md) — 2.2M weekly downloads
- [path-starts-with](https://npm.io/package/path-starts-with.md) — 35.9K weekly downloads
- [redzip](https://npm.io/package/redzip.md) — 1.2K weekly downloads
- [vscode-anymatch](https://npm.io/package/vscode-anymatch.md) — 848 weekly downloads
- [@ledgerhq/coin-filecoin](https://npm.io/package/@ledgerhq/coin-filecoin.md) — 793 weekly downloads

## Recent versions

- 3.1.0 (latest) — 2019-09-07
- 3.0.0 — 2019-09-06
- 2.1.1 — 2017-11-29
- 2.1.0 — 2016-01-03
- 2.0.0 — 2015-10-05
- 1.1.1 — 2015-01-13
- 1.1.0 — 2015-01-03
- 1.0.3 — 2014-10-31
- 1.0.2 — 2014-10-11
- 1.0.1 — 2014-10-06
- 1.0.0 — 2014-10-06

## README

# xdg-trashdir [![Build Status](https://travis-ci.org/kevva/xdg-trashdir.svg?branch=master)](https://travis-ci.org/kevva/xdg-trashdir)

> Get the correct trash path on Linux according to the [spec](http://www.ramendik.ru/docs/trashspec.html)


## Install

```
$ npm install xdg-trashdir
```


## Usage

```js
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.

---
_Source: https://npm.io/package/xdg-trashdir · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
