Skip to content

Commit

Permalink
Meta tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Dec 6, 2019
1 parent c4014c0 commit a2d65aa
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
6 changes: 5 additions & 1 deletion index.js
Expand Up @@ -42,7 +42,11 @@ module.exports = (source, destination, {
...options
} = {}) => {
const progressEmitter = new EventEmitter();
options = {...defaultOptions, ...options};

options = {
...defaultOptions,
...options
};

const promise = (async () => {
source = arrify(source);
Expand Down
7 changes: 4 additions & 3 deletions package.json
Expand Up @@ -4,6 +4,7 @@
"description": "Copy files",
"license": "MIT",
"repository": "sindresorhus/cpy",
"funding": "https://github.com/sponsors/sindresorhus",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
Expand Down Expand Up @@ -52,9 +53,9 @@
},
"devDependencies": {
"ava": "^2.1.0",
"rimraf": "^2.6.3",
"rimraf": "^3.0.0",
"tempfile": "^3.0.0",
"tsd": "^0.7.2",
"xo": "^0.24.0"
"tsd": "^0.11.0",
"xo": "^0.25.3"
}
}
18 changes: 7 additions & 11 deletions readme.md
Expand Up @@ -2,7 +2,6 @@

> Copy files

## Why

- Fast by using streams.
Expand All @@ -11,14 +10,12 @@
- User-friendly error messages.
- Progress reporting.


## Install

```
$ npm install cpy
```


## Usage

```js
Expand All @@ -30,7 +27,6 @@ const cpy = require('cpy');
})();
```


## API

### cpy(source, destination, options?)
Expand Down Expand Up @@ -61,21 +57,21 @@ In addition, you can specify the below options.

##### cwd

Type: `string`<br>
Type: `string`\
Default: `process.cwd()`

Working directory to find source files.

##### overwrite

Type: `boolean`<br>
Type: `boolean`\
Default: `true`

Overwrite existing files.

##### parents

Type: `boolean`<br>
Type: `boolean`\
Default: `false`

Preserve path structure.
Expand All @@ -98,14 +94,14 @@ const cpy = require('cpy');

##### concurrency

Type: `number`<br>
Type: `number`\
Default: `(os.cpus().length || 1) * 2`

Number of files being copied concurrently.

##### ignoreJunk

Type: `boolean`<br>
Type: `boolean`\
Default: `true`

Ignores [junk](https://github.com/sindresorhus/junk) files.
Expand All @@ -124,7 +120,8 @@ Type: `Function`
{
completedFiles: number,
totalFiles: number,
completedSize: number
completedSize: number,
percent: number
}
```

Expand All @@ -141,7 +138,6 @@ Note that the `.on()` method is available only right after the initial `cpy` cal
})();
```


## Related

- [cpy-cli](https://github.com/sindresorhus/cpy-cli) - CLI for this module
Expand Down

0 comments on commit a2d65aa

Please sign in to comment.