You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+9-8Lines changed: 9 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@
11
11
12
12
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.
13
13
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).
15
15
16
16
> There is 1 major difference though, any options must be provided after the command as a suffix (the original project had them as prefix)
17
17
@@ -38,7 +38,8 @@ npm install native-copyfiles -g
38
38
-h, --help Show help [boolean]
39
39
```
40
40
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)
42
43
43
44
copy some files, give it a bunch of arguments, (which can include globs), the last one
44
45
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
47
48
copyfiles foo foobar foo/bar/*.js out
48
49
```
49
50
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.
52
53
53
54
If all the files are in a folder that you don't want in the path out path, ex:
54
55
55
56
```bash
56
57
copyfiles something/*.js out
57
58
```
58
59
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
60
61
61
62
```bash
62
63
copyfiles something/*.js out -u 1
63
64
```
64
65
65
66
which would put all the js files in `out`
66
67
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"`
68
69
69
70
```bash
70
71
copyfiles ./foo/*.txt ./foo/bar/*.txt out -f
71
72
```
72
73
73
-
will put "a.txt" and "b.txt" into out
74
+
will put `"a.txt"` and `"b.txt"` into out
74
75
75
76
if your terminal doesn't support globstars then you can quote them
76
77
@@ -93,7 +94,7 @@ You could quote globstars as a part of input:
0 commit comments