summaryrefslogtreecommitdiff
path: root/deps/npm/lib/utils/move.js
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/lib/utils/move.js')
-rw-r--r--deps/npm/lib/utils/move.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/deps/npm/lib/utils/move.js b/deps/npm/lib/utils/move.js
new file mode 100644
index 0000000000..242e87d37f
--- /dev/null
+++ b/deps/npm/lib/utils/move.js
@@ -0,0 +1,19 @@
+'use strict'
+module.exports = wrappedMove
+
+var fs = require('graceful-fs')
+var move = require('move-concurrently')
+var Bluebird = require('bluebird')
+
+function wrappedMove (from, to, cb) {
+ var movePromise = move(from, to, {fs: fs, Promise: Bluebird, maxConcurrency: 4})
+ if (cb) {
+ return movePromise.then(function (value) {
+ cb(value)
+ }, function (err) {
+ cb(err)
+ })
+ } else {
+ return movePromise
+ }
+}