# copymitter

> copy files with emitter

Latest version **10.3.2** (published 2026-04-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install copymitter
pnpm add copymitter
yarn add copymitter
bun add copymitter
```

## Health

**Score 50/100 (C)** — status: active.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 10.3.2 |
| Published | 2026-04-12 |
| First published | 2015-02-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=22 |
| Dependencies | 10 |
| Unpacked size | 21.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | coderaiser |
| Maintainers | coderaiser |
| Keywords | copy, progress, size, emitter, file |

## Links

- npm: https://www.npmjs.com/package/copymitter
- Repository: https://github.com/coderaiser/node-copymitter
- Issues: https://github.com/coderaiser/node-copymitter/issues
- npm.io page: https://npm.io/package/copymitter

## Dependencies (10)

- [debug](https://npm.io/package/debug.md) ^4.0.1
- [squad](https://npm.io/package/squad.md) ^3.0.0
- [zames](https://npm.io/package/zames.md) ^3.0.0
- [redzip](https://npm.io/package/redzip.md) ^4.0.1
- [currify](https://npm.io/package/currify.md) ^4.0.0
- [findit2](https://npm.io/package/findit2.md) ^2.2.3
- [through2](https://npm.io/package/through2.md) ^4.0.2
- [fullstore](https://npm.io/package/fullstore.md) ^4.0.0
- [copy-symlink](https://npm.io/package/copy-symlink.md) ^2.0.0
- [try-to-catch](https://npm.io/package/try-to-catch.md) ^4.0.5

## Alternatives

- [async-exit-hook](https://npm.io/package/async-exit-hook.md) — 3.7M weekly downloads
- [evnty](https://npm.io/package/evnty.md) — 7.2K weekly downloads
- [eleventy-plugin-asciidoc](https://npm.io/package/eleventy-plugin-asciidoc.md) — 3.5K weekly downloads
- [@jswork/next-get2get](https://npm.io/package/@jswork/next-get2get.md) — 945 weekly downloads
- [@dashersw/axon](https://npm.io/package/@dashersw/axon.md) — 934 weekly downloads

## Recent versions

- 10.3.2 (latest) — 2026-04-12
- 10.3.1 — 2026-04-12
- 10.3.0 — 2026-02-26
- 10.2.0 — 2026-02-25
- 10.1.0 — 2026-02-21
- 10.0.2 — 2026-02-16
- 10.0.1 — 2026-02-15
- 10.0.0 — 2026-02-15
- 9.0.0 — 2024-05-06
- 8.1.0 — 2023-08-09
- 8.0.1 — 2023-03-21
- 8.0.0 — 2023-03-21
- 7.0.0 — 2022-10-09
- 6.0.4 — 2021-02-27
- 6.0.3 — 2021-02-18
- … 80 more at https://npm.io/package/copymitter/versions

## README

# Copymitter [![License][LicenseIMGURL]][LicenseURL] [![NPM version][NPMIMGURL]][NPMURL] [![Build Status][BuildStatusIMGURL]][BuildStatusURL] [![Coverage Status][CoverageIMGURL]][CoverageURL]

[NPMIMGURL]: https://img.shields.io/npm/v/copymitter.svg?style=flat
[BuildStatusURL]: https://github.com/coderaiser/node-copymitter/actions?query=workflow%3A%22Node+CI%22 "Build Status"
[BuildStatusIMGURL]: https://github.com/coderaiser/node-copymitter/workflows/Node%20CI/badge.svg
[LicenseIMGURL]: https://img.shields.io/badge/license-MIT-317BF9.svg?style=flat
[CoverageIMGURL]: https://coveralls.io/repos/coderaiser/node-copymitter/badge.svg?branch=master&service=github
[NPMURL]: https://npmjs.org/package/copymitter "npm"
[LicenseURL]: https://tldrlegal.com/license/mit-license "MIT License"
[CoverageURL]: https://coveralls.io/github/coderaiser/node-copymitter?branch=master

Copy files with emitter (even from and to `zip archives`). It will emit event on every percent of copied chunk of data.
Good for making progress bars.

### Install

```
npm i copymitter
```

### How to use?

```js
import {copymitter} from 'copymitter';

const cwd = process.cwd();
const from = `${cwd}/pipe-io`;
const to = `${cwd}/example`;
const abortOnError = false;

const cp = copymitter(from, to, ['LICENSE', 'README.md', 'package.json']);

cp.on('file', (from, to) => {
    console.log(`${from} -> ${to}`);
});

cp.on('directory', (from, to) => {
    console.log(`${from} -> ${to}`);
});

cp.on('progress', (percent) => {
    console.log(percent);
    
    if (percent >= 50) {
        cp.pause();
        cp.continue();
    }
});

cp.on('pause', () => {
    console.log('paused');
    cp.continue();
});

cp.on('error', (error) => {
    console.error(error.message);
    
    if (abortOnError) {
        cp.abort();
        return;
    }
    
    cp.continue();
});

cp.on('abort', () => {
    console.log('Copying aborted');
});

cp.on('end', ({errors}) => {
    console.log('Copying ended up');
});

cp.pause();
```

## Related

- [Remy](https://github.com/coderaiser/node-remy "Remy") - Remove files with emitter.
- [Jaguar](https://github.com/coderaiser/node-jaguar "Jaguar") - Pack and extract .tar.gz archives with emitter.
- [OneZip](https://github.com/coderaiser/node-onezip "OneZip") - Pack and extract zip archives with emitter.
- [Tar-to-zip](https://github.com/coderaiser/node-tar-to-zip "tar-to-zip") - Convert tar and tar.gz archives to zip.

## License

MIT

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