npm/move-concurrently

Name: move-concurrently

Owner: npm

Description: Promises of moves of files or directories with rename, falling back to recursive rename/copy on EXDEV errors, with configurable concurrency and win32 junction support.

Created: 2017-02-17 21:31:35.0

Updated: 2018-05-18 15:55:29.0

Pushed: 2018-01-23 00:02:05.0

Homepage: https://www.npmjs.com/package/move-concurrently

Size: 10

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

move-concurrently

Move files and directories.

t move = require('move-concurrently')
('/path/to/thing', '/new/path/thing').then(() => {
 thing is now moved!
atch(err => {
 oh no!

Uses rename to move things as fast as possible.

If you move across devices or on filesystems that don't support renaming large directories. That is, situations that result in rename returning the EXDEV error, then move will fallback to copy + delete.

When recursively copying directories it will first try to rename the contents before falling back to copying. While this will be slightly slower in true cross-device scenarios, it is MUCH faster in cases where the filesystem can't handle directory renames.

When copying ownership is maintained when running as root. Permissions are always maintained. On Windows, if symlinks are unavailable then junctions will be used.

INTERFACE
move(from, to, options) ? Promise

Recursively moves from to to and resolves its promise when finished. If to already exists then the promise will be rejected with an EEXIST error.

Starts by trying to rename from to to.

Options are:

Options can also include dependency injection:


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.