Skip to content

Commit 0088dfc

Browse files
authored
docs: improve documentation and fix some typos
1 parent d8ec7d9 commit 0088dfc

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
Copy files easily via JavaScript or the CLI, it uses [tinyglobby](https://www.npmjs.com/package/tinyglobby) internally for glob patterns and [yargs](https://www.npmjs.com/package/yargs) for the CLI.
1313

14-
The library is similar to the [copyfiles](https://www.npmjs.com/package/copyfiles) package, it is however written with more native NodeJS APIs and less dependencies. The package options are exactly the same (except for `--soft` which is not implemented).
14+
The library is nearly the same as the [copyfiles](https://www.npmjs.com/package/copyfiles) package, it is however written with more native NodeJS APIs and less dependencies. The package options are exactly the same (except for `--soft` which is not implemented).
1515

1616
> There is 1 major difference though, any options must be provided after the command as a suffix (the original project had them as prefix)
1717
@@ -38,7 +38,8 @@ npm install native-copyfiles -g
3838
-h, --help Show help [boolean]
3939
```
4040
41-
> Note: as opposed to the original [copyfiles](https://www.npmjs.com/package/copyfiles) project, any options **must** be provided as a suffix.
41+
> [!NOTE]
42+
> Options **must** be provided after the command directories as a suffix (the original project had them as prefix)
4243
4344
copy some files, give it a bunch of arguments, (which can include globs), the last one
4445
is the out directory (which it will create if necessary). Note: on windows globs must be **double quoted**, everybody else can quote however they please.
@@ -47,30 +48,30 @@ is the out directory (which it will create if necessary). Note: on windows glob
4748
copyfiles foo foobar foo/bar/*.js out
4849
```
4950
50-
you now have a directory called out, with the files foo and foobar in it, it also has a directory named foo with a directory named
51-
bar in it that has all the files from foo/bar that match the glob.
51+
you now have a directory called out, with the files `"foo"` and `"foobar"` in it, it also has a directory named `"foo"` with a directory named
52+
`"bar"` in it that has all the files from `"foo/bar"` that match the glob.
5253
5354
If all the files are in a folder that you don't want in the path out path, ex:
5455
5556
```bash
5657
copyfiles something/*.js out
5758
```
5859
59-
which would put all the js files in `out/something`, you can use the `--up` (or `-u`) option
60+
which would put all the js files in `"out/something"`, you can use the `--up` (or `-u`) option
6061
6162
```bash
6263
copyfiles something/*.js out -u 1
6364
```
6465
6566
which would put all the js files in `out`
6667
67-
you can also just do `-f` which will flatten all the output into one directory, so with files "./foo/a.txt" and "./foo/bar/b.txt"
68+
you can also just do `-f` which will flatten all the output into one directory, so with files `"./foo/a.txt"` and `"./foo/bar/b.txt"`
6869
6970
```bash
7071
copyfiles ./foo/*.txt ./foo/bar/*.txt out -f
7172
```
7273
73-
will put "a.txt" and "b.txt" into out
74+
will put `"a.txt"` and `"b.txt"` into out
7475
7576
if your terminal doesn't support globstars then you can quote them
7677
@@ -93,7 +94,7 @@ You could quote globstars as a part of input:
9394
copyfiles some.json "./some_folder/*.json" ./dist/ && echo 'JSON files copied.'
9495
```
9596
96-
You can use the `-e` option to exclude some files from the pattern, so to exclude all files ending in ".test.js" you could do
97+
You can use the `-e` option to exclude some files from the pattern, so to exclude all files ending in `".test.js"` you could do
9798
9899
```bash
99100
copyfiles "**/*.test.js" -f ./foo/**/*.js out -e

0 commit comments

Comments
 (0)