Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

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.4.1 to 3.4.2

lib/macos-trash

9

index.js

@@ -5,2 +5,5 @@ 'use strict';

var globby = require('globby');
var macos = require('./lib/macos');
var linux = require('./lib/linux');
var win = require('./lib/win');

@@ -23,6 +26,6 @@ module.exports = function (paths) {

switch (process.platform) {
case 'darwin': return require('./lib/osx')(paths);
case 'win32': return require('./lib/win')(paths);
default: return require('./lib/linux')(paths);
case 'darwin': return macos(paths);
case 'win32': return win(paths);
default: return linux(paths);
}
};

@@ -8,2 +8,3 @@ 'use strict';

var xdgTrashdir = require('xdg-trashdir');
var fs = pify(fsExtra, Promise);

@@ -10,0 +11,0 @@

@@ -6,2 +6,3 @@ 'use strict';

var pify = require('pify');
var bin = path.join(__dirname, 'win-trash.exe');

@@ -8,0 +9,0 @@

{
"name": "trash",
"version": "3.4.1",
"version": "3.4.2",
"description": "Move files and folders to the trash",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -7,3 +7,3 @@ # ![trash](https://cdn.rawgit.com/sindresorhus/trash/1cdbd660976d739eeb45447bb6b62c41ac4a3ecf/media/logo.svg)

Works on OS X, Linux, and Windows.
Works on macOS, Linux, and Windows.

@@ -44,4 +44,4 @@ In contrast to [`fs.unlink`](https://nodejs.org/api/fs.html#fs_fs_unlink_path_callback), [`del`](https://github.com/sindresorhus/del), and [`rimraf`](https://github.com/isaacs/rimraf) which permanently delete files, this only moves them to the trash, which is much safer and reversible.

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 macOS, [`macos-trash`](https://github.com/sindresorhus/macos-trash) is used.<br>
On Linux, the [XDG spec](http://standards.freedesktop.org/trash-spec/trashspec-1.0.html) is followed.<br>
On Windows, [`recycle-bin`](https://github.com/sindresorhus/recycle-bin) is used.

@@ -54,3 +54,3 @@

Not really. The `mv` command isn't cross-platform and moving to trash is not just about moving the file to a "trash" directory. On all OSes you'll run into file conflicts. The user won't easily be able to restore the file. It won't work on an external drive. The trash directory location varies between Windows versions. For Linux, there's a whole [spec](http://www.ramendik.ru/docs/trashspec.html) you need to follow. On OS X, you'll lose the [Put back](http://mac-fusion.com/trash-tip-how-to-put-files-back-to-their-original-location/) feature.
Not really. The `mv` command isn't cross-platform and moving to trash is not just about moving the file to a "trash" directory. On all OSes you'll run into file conflicts. The user won't easily be able to restore the file. It won't work on an external drive. The trash directory location varies between Windows versions. For Linux, there's a whole [spec](http://www.ramendik.ru/docs/trashspec.html) you need to follow. On macOS, you'll lose the [Put back](http://mac-fusion.com/trash-tip-how-to-put-files-back-to-their-original-location/) feature.

@@ -67,2 +67,2 @@

MIT © [Sindre Sorhus](http://sindresorhus.com)
MIT © [Sindre Sorhus](https://sindresorhus.com)
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