npm/copy-concurrently

Name: copy-concurrently

Owner: npm

Description: Promises of copies of files, directories and symlinks, with concurrency controls and win32 junction fallback.

Created: 2017-02-27 03:29:32.0

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

Pushed: 2018-01-23 00:37:18.0

Homepage:

Size: 19

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

copy-concurrently

Copy files, directories and symlinks

t copy = require('copy-concurrently')
('/path/to/thing', '/new/path/thing').then(() => {
 this is now copied
atch(err => {
 oh noooo

Copies files, directories and symlinks. Ownership is maintained when running as root, permissions are always maintained. On Windows, if symlinks are unavailable then junctions will be used.

PUBLIC INTERFACE
copy(from, to, [options]) ? Promise

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

Options are:

Options can also include dependency injection:

EXTENSION INTERFACE

Ordinarily you'd only call copy above. But it's possible to use it's component functions directly. This is useful if, say, you're writing move-concurently.

copy.file(from, to, options) ? Promise

Copies an ordinary file from to destination to. Uses fs-write-stream-atomic to ensure that the file is either entirely copied or not at all.

Options are:

copy.symlink(from, to, options) ? Promise

Copies a symlink from to destination to. If you're using Windows and symlinking fails and what you're linking is a directory then junctions will be tried instead.

Options are:

copy.recurse(from, to, options) ? Promise

Reads all of the files in directory from and adds them to the queue using recurseWith (by default copy.item).

Options are:

copy.item(from, to, options) ? Promise

Copies some kind of from to destination to. This looks at the filetype and calls copy.file, copy.symlink or copy.recurse as appropriate.

Symlink copies are queued with a priority such that they happen after all file and directory copies as you can't create a junction on windows to a file that doesn't exist yet.

Options are:


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.