Skip to content

Commit 101a03b

Browse files
authored
docs: improve documentation
1 parent c3c1e04 commit 101a03b

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
Copy files easily via JavaScript or the CLI and cross-platform usage using [cli-nano](https://www.npmjs.com/package/cli-nano) dependency for the CLI.
1414

15-
The library is very similar to the [copyfiles](https://www.npmjs.com/package/copyfiles) package, at least from the outside; however it is quite different internally. It uses native NodeJS as much as possible and so as a lot less dependencies (just 2 instead of 7), which makes this package a lot smaller compared to the original `copyfiles` project (1.8kB instead of 27.6kB gzip). The options are nearly the same (except for `--soft`, which is not implemented), there's also some new features that were added in this project (mainly the copy & rename and also dry-run features, see below).
15+
The library is very similar to the [copyfiles](https://www.npmjs.com/package/copyfiles) package, at least from the outside; however it is quite different internally. It uses native NodeJS code as much as possible and only has 2 dependencies (instead of 7 in `copyfiles`), which makes this package a lot smaller compared to the original `copyfiles` project (1.85kB instead of 27.6kB gzip). The options are nearly the same (except for `--soft`, which is not implemented), there's also some new features that were added in this project (mainly the copy/rename and also a dry-run feature, see below).
1616

1717
> [!NOTE]
1818
> There is 1 noticeable difference with `copyfiles` package, all the CLI options must be provided as suffix and after the source/target directories command (the original `copyfiles` project has them as prefix).<br>
@@ -233,13 +233,13 @@ The `rename` callback gives you full control over the output filename and path.
233233
```js
234234
import { copyfiles } from 'native-copyfiles';
235235

236-
copyfiles(sources, destination, opt, callback);
236+
copyfiles(source[s], destination, options, callback);
237237
```
238238

239239
1. first argument is a string or an array of source paths
240240
2. second argument is the destination path
241-
3. third argument (`opt`) is the "options" argument
242-
4. and finally the last argument is a callback function that will be executed after the copy process
241+
3. third argument is the optional "options" argument
242+
4. and finally the last argument is an optional callback function that will be executed after the copy process ended
243243

244244
```js
245245
{
@@ -256,4 +256,4 @@ copyfiles(sources, destination, opt, callback);
256256
```
257257

258258
> [!WARNING]
259-
> Version 2.0 changed the JS API and moved the destination as the 2nd argument (which is different compared to v1.0 which previously had its destination inside the 1st argument array as the last element which was super confusing).
259+
> Version 2.0 changed the JS API and moved the destination as the 2nd argument (which is different compared to v1.0 which previously had its sources and destination inside the 1st argument array which was super confusing).

0 commit comments

Comments
 (0)