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 1.1.3 to 1.2.0

41

cli.js
#!/usr/bin/env node
'use strict';
var updateNotifier = require('update-notifier');
var argv = require('minimist')(process.argv.slice(2), {string: ['_']});
var pkg = require('./package.json');
var meow = require('meow');
var trash = require('./');
var input = argv._;
function help() {
console.log([
var cli = meow({
help: [
'Usage',
' trash <path> [<path> ...]',
'',
' ' + pkg.description,
'',
' Usage',
' trash <path> [<path> ...]',
'',
' Example',
' trash unicorn.png rainbow.png'
].join('\n'));
}
'Example',
' trash unicorn.png rainbow.png'
].join('\n')
}, {
string: ['_']
});
updateNotifier({
packageName: pkg.name,
packageVersion: pkg.version
packageName: cli.pkg.name,
packageVersion: cli.pkg.version
}).notify();
if (argv.version) {
console.log(pkg.version);
return;
}
if (input.length === 0 || argv.help) {
help();
return;
}
trash(input, function (err) {
trash(cli.input, function (err) {
if (err) {

@@ -39,0 +26,0 @@ console.error(err.message);

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

var runApplescript = require('run-applescript');
var xdgTrash = require('xdg-trash');

@@ -28,15 +29,2 @@ function osx(paths, cb) {

function linux(paths, cb) {
execFile('./trash-put', paths, {
cwd: path.join(__dirname, 'vendor')
}, function (err) {
if (err && /cannot trash non existent/.test(err.message)) {
cb(new Error('Item doesn\'t exist'));
return;
}
cb(err);
});
}
function win(paths, cb) {

@@ -71,3 +59,3 @@ execFile('./Recycle.exe', ['-f'].concat(paths), {

linux(paths, cb);
xdgTrash(paths, cb);
};
{
"name": "trash",
"version": "1.1.3",
"version": "1.2.0",
"description": "Cross-platform command-line app for moving files and directories to the trash - A safer alternative to `rm`",

@@ -24,5 +24,3 @@ "license": "MIT",

"cli.js",
"vendor/cmdutils",
"vendor/trash-cli/trashcli/*.py",
"vendor/trash-put"
"vendor/cmdutils"
],

@@ -48,5 +46,6 @@ "keywords": [

"escape-string-applescript": "^1.0.0",
"minimist": "^1.1.0",
"meow": "^1.0.0",
"run-applescript": "^1.0.0",
"update-notifier": "^0.2.1"
"update-notifier": "^0.2.1",
"xdg-trash": "^1.0.0"
},

@@ -53,0 +52,0 @@ "devDependencies": {

# ![trash](https://cdn.rawgit.com/sindresorhus/trash/3aa70853f1efb58d0d2512e32d617d246c88953c/media/logo.svg)
> Cross-platform command-line app for moving files and directories to the trash - A safer alternative to [`rm`](http://en.wikipedia.org/wiki/Rm_(Unix))
> Cross-platform command-line app for moving files and directories to the trash
> A safer alternative to [`rm`](http://en.wikipedia.org/wiki/Rm_(Unix))

@@ -50,3 +51,3 @@ [![Build Status](https://travis-ci.org/sindresorhus/trash.svg?branch=master)](https://travis-ci.org/sindresorhus/trash) ![](http://img.shields.io/badge/unicorn-approved-ff69b4.svg)

On Linux [trash-cli](https://github.com/andreafrancia/trash-cli) is used. Requires Python. [Help wanted on a Node version.](https://github.com/sindresorhus/trash/issues/1)
On Linux [xdg-trash](https://github.com/kevva/xdg-trash) is used.

@@ -68,4 +69,9 @@ On Windows [cmdutils](http://www.maddogsw.com/cmdutils/) is used.

## Related
See [`empty-trash`](https://github.com/sindresorhus/empty-trash) for emptying the trash.
## License
MIT © [Sindre Sorhus](http://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