# @apexearth/copy 中文文档

规范地址：https://npmcn.com/package/%40apexearth/copy/

版本：1\.4\.5
npm 元数据更新时间：2022-04-04T14:33:12.912Z
中文译文更新时间：2026-11-06T09:11:14.386Z
软件包许可：ISC

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40apexearth/copy
原文对照：https://npmcn.com/package/%40apexearth/copy/?lang=original
项目主页：https://github.com/apexearth/copy#readme
源码仓库：https://github.com/apexearth/copy

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：16.4 kB，4 个文件
- 模块格式：CommonJS
- TypeScript 类型：未声明
- 运行依赖：4 个
- 首次发布：2019-03-02T02:10:13.450Z
- 最新版本发布：2020-04-13T04:37:42.438Z
- 近 30 天下载量：5303（2026-10-06 至 2026-11-04，npm 官方下载统计）
- 已发布版本数：19（近 12 个月 0 个）

## 中文简介

通过节点或命令行复制文件!

## 安装

```sh
npm install @apexearth/copy
```

也可以使用：`pnpm add @apexearth/copy`、`yarn add @apexearth/copy`、`bun add @apexearth/copy`

## README

# @ apexearth/ 副本

![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)

通过命令行或节点.js复制文件.

## 为什么?

-   通过国家保存恢复能力,可以复制数十万个文件,而不必重新开始.
-   并行传输可以提高较小文件在Samba等网络连接上传输的速度.
-   因为有时候你需要复制 **许多** 东西!

## 安装

### 节点使用

```
$ npm i @apexearth/copy
```

### 命令行使用量

```
$ npm i @apexearth/copy -g
```

## 使用量

### 节点使用

```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))
```

### 命令行使用量

```
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
```

## 常见问题

### @apexearth/copy 是什么？

通过节点或命令行复制文件\!

### 如何安装 @apexearth/copy？

在项目目录运行 npm install @apexearth/copy，或使用 pnpm add / yarn add / bun add。它还提供命令行工具 node-copy，可以用 npx node-copy 直接运行。

### @apexearth/copy 支持 TypeScript 吗？

该包的 package\.json 没有声明类型入口。需要类型提示时，可以在 npm 上查找社区维护的 @types/apexearth\_\_copy 是否存在。

### @apexearth/copy 支持 ESM 还是 CommonJS？

以 CommonJS 形式发布，可以直接 require\(\)；在 ES Module 项目中也可以用 import 引入（Node\.js 会把 module\.exports 作为默认导出）。

### @apexearth/copy 可以商用吗？

@apexearth/copy 使用 ISC 许可。宽松许可：允许商业使用、修改和再分发，通常只需在分发时保留原版权与许可声明。以上为概括，不构成法律意见，请以许可原文为准。

### @apexearth/copy 的下载量有多少？

根据 npm 官方下载统计，@apexearth/copy 在 2026/10/06 – 2026/11/04 这 30 天内被下载 5,303 次，日均约 177 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入，适合横向比较热度，不能直接等同于使用人数。

### @apexearth/copy 还在维护吗？

最新版本 1\.4\.5 发布于 2020/04/13（6 年前）；至今共发布 19 个版本，其中过去 12 个月发布了 0 个；首次发布于 2019/03/02。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

