# directory-copy

> Copy the contents of one directory to another

Latest version **0.1.0** (published 2013-12-09) · BSD license · 0 weekly downloads

## Install

```sh
npm install directory-copy
pnpm add directory-copy
yarn add directory-copy
bun add directory-copy
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2013-12-09 |
| First published | 2013-01-17 |
| Weekly downloads | 0 |
| License | BSD |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | bengourley |

## Links

- npm: https://www.npmjs.com/package/directory-copy
- npm.io page: https://npm.io/package/directory-copy

## Dependencies (3)

- [glob](https://npm.io/package/glob.md) ~3.1.14
- [async](https://npm.io/package/async.md) ~0.1.22
- [mkdirp](https://npm.io/package/mkdirp.md) ~0.3.4

## Recent versions

- 0.1.0 (latest) — 2013-12-09
- 0.0.4 — 2013-01-23
- 0.0.3 — 2013-01-22
- 0.0.2 — 2013-01-22
- 0.0.1 — 2013-01-17
- 0.0.0 — 2013-01-17

## README

[![Build Status](https://travis-ci.org/bengourley/node-directory-copy.png?branch=master)](https://travis-ci.org/bengourley/node-directory-copy)

Copy the contents of one directory to another, and leave behind specified exclusions.

## Install

```
npm install directory-copy
```

## Usage

```js
var copy = require('directory-copy')
```

### copy(options, cb)

- `options` is an options hash
  - `src` the source directory (required)
  - `dest` the destination directory (required)
  - `excludes` an array of RegExp objects to `.test()` filenames
    against. If the test returns true, the file won't be copied.
- `cb` is the callback `function (err) {}` (`err` is null if ok)

`copy()` returns an event emitter that emits 'log' events.

Eg:
```js
copy(
    { src: __dirname + '/source/static'
    , dest: __dirname + '/output/static'
    , excludes: [ /^\./ ] // Exclude hidden files
    }
  , function () {
    console.log('done!')
  })
  .on('log', function (msg, level) {
    // Level is debug, info, warn or error
    console.log(level + ': ' + msg)
  })
```

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