# fs-cp

> copy a file or a stream to another file

Latest version **1.4.0** (published 2016-02-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install fs-cp
pnpm add fs-cp
yarn add fs-cp
bun add fs-cp
```

## 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.0 |
| Published | 2016-02-28 |
| First published | 2014-08-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 10 |
| Author | Jonathan Ong |
| Maintainers | jongleberry |
| Keywords | fs, cp, copy |

## Links

- npm: https://www.npmjs.com/package/fs-cp
- Repository: https://github.com/fs-utils/cp
- Homepage: https://github.com/fs-utils/cp#readme
- Issues: https://github.com/fs-utils/cp/issues
- npm.io page: https://npm.io/package/fs-cp

## Dependencies (4)

- [mz](https://npm.io/package/mz.md) ^2.0.0
- [destroy](https://npm.io/package/destroy.md) ^1.0.0
- [any-promise](https://npm.io/package/any-promise.md) ^1.1.0
- [mkdirp-then](https://npm.io/package/mkdirp-then.md) ^1.0.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.4.0 (latest) — 2016-02-28
- 1.3.1 — 2015-06-05
- 1.3.0 — 2014-12-03
- 1.2.0 — 2014-08-23
- 1.1.0 — 2014-08-14
- 1.0.0 — 2014-08-14

## README

# cp

[![NPM version][npm-image]][npm-url]
[![Build status][travis-image]][travis-url]
[![Test coverage][coveralls-image]][coveralls-url]
[![Dependency Status][david-image]][david-url]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url]

A tiny utility to help you copy files:

- Always cleans up file descriptors
- `mkdir -p` support
- Promise support
- No half-written files
- Insusceptible to race conditions, meaning you can do multiple copies fine

## API

```js
var cp = require('fs-cp')

// file to file
cp('package.json', 'package2.json').then(function () {

})

// stream to file
cp(res, 'response.json').then(function () {

})
```

[npm-image]: https://img.shields.io/npm/v/fs-cp.svg?style=flat-square
[npm-url]: https://npmjs.org/package/fs-cp
[github-tag]: http://img.shields.io/github/tag/fs-utils/cp.svg?style=flat-square
[github-url]: https://github.com/fs-utils/cp/tags
[travis-image]: https://img.shields.io/travis/fs-utils/cp.svg?style=flat-square
[travis-url]: https://travis-ci.org/fs-utils/cp
[coveralls-image]: https://img.shields.io/coveralls/fs-utils/cp.svg?style=flat-square
[coveralls-url]: https://coveralls.io/r/fs-utils/cp?branch=master
[david-image]: http://img.shields.io/david/fs-utils/cp.svg?style=flat-square
[david-url]: https://david-dm.org/fs-utils/cp
[license-image]: http://img.shields.io/npm/l/cp.svg?style=flat-square
[license-url]: LICENSE.md
[downloads-image]: http://img.shields.io/npm/dm/fs-cp.svg?style=flat-square
[downloads-url]: https://npmjs.org/package/fs-cp

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