# @timsuchanek/copy

> Copy files via Node or command-line!

Latest version **1.4.5** (published 2020-09-11) · ISC license · 0 weekly downloads

## Install

```sh
npm install @timsuchanek/copy
pnpm add @timsuchanek/copy
yarn add @timsuchanek/copy
bun add @timsuchanek/copy
```

Provides the command `node-copy`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.4.5 |
| Published | 2020-09-11 |
| First published | 2020-09-11 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 14.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | apexearth@gmail.com |
| Maintainers | timsuchanek |
| Keywords | cp, copy, data, file, files, fs |

## Links

- npm: https://www.npmjs.com/package/@timsuchanek/copy
- Repository: https://github.com/apexearth/copy
- Homepage: https://github.com/apexearth/copy#readme
- Issues: https://github.com/apexearth/copy/issues
- npm.io page: https://npm.io/package/@timsuchanek/copy

## Dependencies (4)

- [mkdirp](https://npm.io/package/mkdirp.md) ^1.0.4
- [commander](https://npm.io/package/commander.md) ^2.19.0
- [prettysize](https://npm.io/package/prettysize.md) ^2.0.0
- [@timsuchanek/sleep-promise](https://npm.io/package/@timsuchanek/sleep-promise.md) ^8.0.1

## 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.4.5 (latest) — 2020-09-11

## README

# @apexearth/copy

![npm (scoped)](https://img.shields.io/npm/v/@apexearth/copy.svg)
[![Travis Status](https://travis-ci.org/apexearth/copy.svg?branch=master)](https://coveralls.io/github/apexearth/copy?branch=master)
[![Coverage Status](https://coveralls.io/repos/github/apexearth/copy/badge.svg?branch=master)](https://coveralls.io/github/apexearth/copy?branch=master)
![NPM Downloads](https://img.shields.io/npm/dw/@apexearth/copy.svg?style=flat)
[![install size](https://packagephobia.now.sh/badge?p=@apexearth/copy)](https://packagephobia.now.sh/result?p=@apexearth/copy)
![License](https://img.shields.io/npm/l/@apexearth/copy.svg?style=flat)

Copy files via command line or Node.js.

## Why?

- Resume ability via state saving allows you to copy hundreds of thousands of files without having to start over.
- Parallel transfers can increase speed of transferring smaller files over network connections such as Samba.
- Because sometimes you need to copy **a lot of** stuff!

## Installation

### Node.js Usage

    $ npm i @apexearth/copy
    
### Command Line Usage

    $ npm i @apexearth/copy -g
    
## Usage

### Node.js Usage

```javascript
const copy = require('@apexearth/copy')
copy({
    from,                // Source copy path.
    to,                  // Destination copy path.
    recursive,           // Copy recursively.
    overwrite,           // Overwrite existing file
    overwriteMismatches, // Overwrite if size mismatch or from modified date is more recent.
    verbose,             // Verbose output.
    json,                // JSON output. (options: true, "pretty")
    ignoreErrors,        // Continue on errors.
    parallelJobs,        // Number of possible concurrent jobs.
    state,               // Save state for resume ability.
    stateFrequency,      // Save state frequency.
    copyFile,            // Supply your own copyFile function. (from, to, cb)
    readdir,             // Supply your own readdir function. (path, cb)
    stat,                // Supply your own stat function. (path, cb)
})
    .then(() => console.log('done'))
    .catch(err => console.error(err))
```

### Command Line Usage

```
Usage: node-copy [options] <from> <to>

Options:
  -V, --version               output the version number
  -r, --recursive             Copy recursively.
  -o, --overwrite             Overwrite existing.
  --overwrite-mismatches      Overwrite if size mismatch or from modified date is more recent.
  -v, --verbose               Verbose output.
  -j, --json <format>         JSON output. (options: true, pretty)
  -e, --ignore-errors         Ignore errors.
  -p, --parallel-jobs <n>     Number of possible concurrent jobs. (default: 1)
  -s, --state <file>          Save state to file for resume ability.
  --state-frequency <n>       Save state frequency. (In <n> files saved.) (default: 100)
  -a, --archive <state-file>  Attempt to copy as much as possible using options `-mervs <state-file> -p 4` with restart capabilities.
  -h, --help                  output usage information
```

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