# enfscopy-promise

> Copy files, directories and links in node cp -R with promises

Latest version **1.0.0** (published 2017-04-04) · CC-BY-4.0 license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install enfscopy-promise
pnpm add enfscopy-promise
yarn add enfscopy-promise
bun add enfscopy-promise
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2017-04-04 |
| First published | 2017-04-04 |
| Weekly downloads | 0 |
| License | CC-BY-4.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4.2.4 |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Joao Parreira |
| Maintainers | n3okill |
| Keywords | copy, cp, cp -r, dereference, dir, directory, fs, file, file system, filter, limit, link, mkdir, mkdirp, overwrite, preserve, recursive, statistics, stream, timestamps |

## Links

- npm: https://www.npmjs.com/package/enfscopy-promise
- Repository: https://github.com/n3okill/enfscopy-promise
- Issues: https://github.com/n3okill/enfscopy-promise/issues
- npm.io page: https://npm.io/package/enfscopy-promise

## Dependencies (1)

- [enfscopy](https://npm.io/package/enfscopy.md) ^1.0

## Alternatives

- [unionfs](https://npm.io/package/unionfs.md) — 2.2M weekly downloads
- [path-starts-with](https://npm.io/package/path-starts-with.md) — 35.9K weekly downloads
- [redzip](https://npm.io/package/redzip.md) — 1.2K weekly downloads
- [vscode-anymatch](https://npm.io/package/vscode-anymatch.md) — 848 weekly downloads
- [@ledgerhq/coin-filecoin](https://npm.io/package/@ledgerhq/coin-filecoin.md) — 793 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2017-04-04

## README

[![Build Status](https://travis-ci.org/n3okill/enfscopy-promise.svg)](https://travis-ci.org/n3okill/enfscopy-promise)
[![AppVeyor status](https://ci.appveyor.com/api/projects/status/7j3pm4rhdvudcptr?svg=true)](https://ci.appveyor.com/project/n3okill/enfscopy-promise)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/3394b2e345d44960ad52d7df07a26d0f)](https://www.codacy.com/app/n3okill/enfscopy-promise)
[![Donate](https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=64PYTCDH5UNZ6)

[![NPM](https://nodei.co/npm/enfscopy-promise.png)](https://nodei.co/npm/enfscopy-promise/)

enfscopy-promise
================
Module that add copy functionality to node fs module with promises

**enfs** stands for [E]asy [N]ode [fs]

This module is intended to work as a sub-module of [enfs-promise](https://www.npmjs.com/package/enfs-promise)


Description
-----------
This module will add a method that allows the copy of multiple files
and folder in the file system, similar to cp -R

- This module will add following methods to node fs module:
  * copyP
  
Usage
-----
`enfscopy-promise`

```js
    const enfscopy = require("enfscopy-promise");
```

Errors
------
All the methods follows the node culture.
- Async: Every async method returns an Error in the first callback parameter
- Sync: Every sync method throws an Error.


Additional Methods
------------------
- [copyP](#copyp)


### copyP
  - **copyP(srcPath, dstPath, [options], callback)**

> Asynchronously copy items in the file system


[options]:
  * fs (Object): an alternative fs module to use (default will be [enfspatch](https://www.npmjs.com/package/enfspatch))
  * limit (Integer): the limit number of files being copied at a moment (Default: fs module limit or 512)
  * overwrite (Boolean): if true will overwrite destination files if they exist before copy (Default: false)
  * preserveTimestamps (Boolean): if true will preserve the timestamps of copied items (Default: false)
  * stopOnError (Boolean): if true will stop copy execution at first error (Default: false)
  * dereference (Boolean): if true will dereference symlinks copying the items to where it points (default: false)
  * errors (Array or Stream): If array or stream, the errors that occur will be logged and returned


```js
    enfscopy.copyP("/path/to/src/folder", "/path/to/destination").then(function(statistics){
        console.log("Copied %d items with a total size of %d",statistics.items,statistics.size);
    }).catch(function(err){
        throw err;
    });
```


License
-------

Creative Commons Attribution 4.0 International License

Copyright (c) 2016 Joao Parreira <joaofrparreira@gmail.com> [GitHub](https://github.com/n3okill)

This work is licensed under the Creative Commons Attribution 4.0 International License. 
To view a copy of this license, visit [CC-BY-4.0](http://creativecommons.org/licenses/by/4.0/).

---
_Source: https://npm.io/package/enfscopy-promise · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
