From a2d65aa6e46ffa78f861fd65bbdfdde11d9199db Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Fri, 6 Dec 2019 15:27:14 +0700 Subject: [PATCH] Meta tweaks --- index.js | 6 +++++- package.json | 7 ++++--- readme.md | 18 +++++++----------- 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/index.js b/index.js index 202440c..eb887d5 100644 --- a/index.js +++ b/index.js @@ -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); diff --git a/package.json b/package.json index b8e33d3..45b4f10 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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" } } diff --git a/readme.md b/readme.md index 4d513d1..d358d1c 100644 --- a/readme.md +++ b/readme.md @@ -2,7 +2,6 @@ > Copy files - ## Why - Fast by using streams. @@ -11,14 +10,12 @@ - User-friendly error messages. - Progress reporting. - ## Install ``` $ npm install cpy ``` - ## Usage ```js @@ -30,7 +27,6 @@ const cpy = require('cpy'); })(); ``` - ## API ### cpy(source, destination, options?) @@ -61,21 +57,21 @@ In addition, you can specify the below options. ##### cwd -Type: `string`
+Type: `string`\ Default: `process.cwd()` Working directory to find source files. ##### overwrite -Type: `boolean`
+Type: `boolean`\ Default: `true` Overwrite existing files. ##### parents -Type: `boolean`
+Type: `boolean`\ Default: `false` Preserve path structure. @@ -98,14 +94,14 @@ const cpy = require('cpy'); ##### concurrency -Type: `number`
+Type: `number`\ Default: `(os.cpus().length || 1) * 2` Number of files being copied concurrently. ##### ignoreJunk -Type: `boolean`
+Type: `boolean`\ Default: `true` Ignores [junk](https://github.com/sindresorhus/junk) files. @@ -124,7 +120,8 @@ Type: `Function` { completedFiles: number, totalFiles: number, - completedSize: number + completedSize: number, + percent: number } ``` @@ -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