Socket
Socket
Sign inDemoInstall

trash

Package Overview
Dependencies
Maintainers
2
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

trash - npm Package Compare versions

Comparing version 3.0.0 to 3.1.0

lib/linux.js

34

index.js
'use strict';
var path = require('path');
var pathExists = require('path-exists');
if (process.platform === 'darwin') {
module.exports = require('osx-trash');
} else if (process.platform === 'win32') {
module.exports = require('win-trash');
} else {
module.exports = require('xdg-trash');
}
module.exports = function (paths) {
if (!Array.isArray(paths)) {
return Promise.reject(new TypeError('Expected an array'));
}
if (paths.length === 0) {
return Promise.resolve();
}
paths = paths.map(function (x) {
return path.resolve(String(x));
}).filter(function (x) {
return pathExists.sync(x);
});
if (process.platform === 'darwin') {
return require('./lib/osx')(paths);
}
if (process.platform === 'win32') {
return require('./lib/win')(paths);
}
return require('./lib/linux')(paths);
};
{
"name": "trash",
"version": "3.0.0",
"description": "Move files and directories to the trash",
"version": "3.1.0",
"description": "Move files and folders to the trash",
"license": "MIT",

@@ -19,3 +19,4 @@ "repository": "sindresorhus/trash",

"files": [
"index.js"
"index.js",
"lib"
],

@@ -37,12 +38,18 @@ "keywords": [

"directories",
"folder",
"folders",
"xdg"
],
"dependencies": {
"osx-trash": "^2.0.0",
"win-trash": "^2.0.0",
"xdg-trash": "^2.0.1"
"escape-string-applescript": "^1.0.0",
"fs-extra": "^0.24.0",
"path-exists": "^2.0.0",
"pify": "^2.2.0",
"pinkie-promise": "^1.0.0",
"run-applescript": "^2.0.0",
"uuid": "^2.0.1",
"xdg-trashdir": "^2.0.0"
},
"devDependencies": {
"ava": "*",
"path-exists": "^2.0.0",
"tempfile": "^1.1.1",

@@ -49,0 +56,0 @@ "xo": "*"

# ![trash](https://cdn.rawgit.com/sindresorhus/trash/1cdbd660976d739eeb45447bb6b62c41ac4a3ecf/media/logo.svg)
> Move files and directories to the trash
> Move files and folders to the trash

@@ -32,9 +32,7 @@ [![Build Status](https://travis-ci.org/sindresorhus/trash.svg?branch=master)](https://travis-ci.org/sindresorhus/trash)

On OS X, [`osx-trash`](https://github.com/sindresorhus/osx-trash) is used.
On OS X, [`osx-trash`](https://github.com/sindresorhus/osx-trash) is used.
On Linux, the [XDG spec](http://standards.freedesktop.org/trash-spec/trashspec-1.0.html) is followed.
On Windows, [`recycle-bin`](https://github.com/sindresorhus/recycle-bin) is used.
On Linux, [`xdg-trash`](https://github.com/kevva/xdg-trash) is used.
On Windows, [`cmdutils`](http://www.maddogsw.com/cmdutils/) is used.
## FAQ

@@ -51,3 +49,3 @@

- [empty-trash](https://github.com/sindresorhus/empty-trash) - Empty the trash
- [del](https://github.com/sindresorhus/del) - Delete files/folders using globs
- [del](https://github.com/sindresorhus/del) - Delete files and folders using globs

@@ -54,0 +52,0 @@

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