Comparing version 3.1.2 to 3.2.0
'use strict'; | ||
var path = require('path'); | ||
var pathExists = require('path-exists'); | ||
var globby = require('globby'); | ||
@@ -15,3 +16,9 @@ module.exports = function (paths) { | ||
paths = paths.map(function (x) { | ||
return path.resolve(String(x)); | ||
return String(x); | ||
}); | ||
paths = globby.sync(paths, {nonull: true}); | ||
paths = paths.map(function (x) { | ||
return path.resolve(x); | ||
}).filter(function (x) { | ||
@@ -18,0 +25,0 @@ return pathExists.sync(x); |
@@ -8,3 +8,3 @@ 'use strict'; | ||
var xdgTrashdir = require('xdg-trashdir'); | ||
var fs = pify.all(fsExtra, Promise); | ||
var fs = pify(fsExtra, Promise); | ||
@@ -11,0 +11,0 @@ function trash(src) { |
{ | ||
"name": "trash", | ||
"version": "3.1.2", | ||
"version": "3.2.0", | ||
"description": "Move files and folders to the trash", | ||
@@ -44,4 +44,5 @@ "license": "MIT", | ||
"fs-extra": "^0.24.0", | ||
"globby": "^3.0.1", | ||
"path-exists": "^2.0.0", | ||
"pify": "^2.2.0", | ||
"pify": "^2.3.0", | ||
"pinkie-promise": "^1.0.0", | ||
@@ -48,0 +49,0 @@ "run-applescript": "^2.0.0", |
@@ -24,3 +24,3 @@ # ![trash](https://cdn.rawgit.com/sindresorhus/trash/1cdbd660976d739eeb45447bb6b62c41ac4a3ecf/media/logo.svg) | ||
trash(['unicorn.png', 'rainbow.png']).then(() => { | ||
trash(['*.png', '!rainbow.png']).then(() => { | ||
console.log('done'); | ||
@@ -30,3 +30,14 @@ }); | ||
*You can use [glob patterns](https://github.com/sindresorhus/globby#globbing-patterns).** | ||
## CLI | ||
To install the [`trash`](https://github.com/sindresorhus/trash-cli) command, run: | ||
``` | ||
$ npm install --global trash-cli | ||
``` | ||
## Info | ||
@@ -33,0 +44,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
34029
102
65
9
+ Addedglobby@^3.0.1
+ Addedarray-union@1.0.2(transitive)
+ Addedarray-uniq@1.0.3(transitive)
+ Addedarrify@1.0.1(transitive)
+ Addedglob@5.0.15(transitive)
+ Addedglobby@3.0.1(transitive)
Updatedpify@^2.3.0