Socket
Socket
Sign inDemoInstall

xdg-trashdir

Package Overview
Dependencies
Maintainers
2
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

xdg-trashdir

Get the correct trash path on Linux


Version published
Weekly downloads
68K
increased by0.88%
Maintainers
2
Weekly downloads
 
Created
Source

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');

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

Keywords

FAQs

Package last updated on 29 Nov 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc