@@ -693,6 +693,37 @@ try {
693
693
}
694
694
` ` `
695
695
696
+ ### ` fsPromises .cp (src, dest[, options])`
697
+ <!-- YAML
698
+ added: REPLACEME
699
+ -->
700
+
701
+ > Stability: 1 - Experimental
702
+
703
+ * ` src` {string|URL} source path to copy.
704
+ * ` dest` {string|URL} destination path to copy to.
705
+ * ` options` {Object}
706
+ * ` dereference` {boolean} dereference symlinks. **Default:** ` false ` .
707
+ * ` errorOnExist` {boolean} when ` force` is ` false ` , and the destination
708
+ exists, throw an error. **Default:** ` false ` .
709
+ * ` filter` {Function} Function to filter copied files/directories. Return
710
+ ` true ` to copy the item, ` false ` to ignore it. Can also return a ` Promise `
711
+ that resolves to ` true ` or ` false ` **Default:** ` undefined ` .
712
+ * ` force` {boolean} overwrite existing file or directory. _The copy
713
+ operation will ignore errors if you set this to false and the destination
714
+ exists. Use the ` errorOnExist` option to change this behavior.
715
+ **Default:** ` true ` .
716
+ * ` preserveTimestamps` {boolean} When ` true ` timestamps from ` src` will
717
+ be preserved. **Default:** ` false ` .
718
+ * ` recursive` {boolean} copy directories recursively **Default:** ` false `
719
+ * Returns: {Promise} Fulfills with ` undefined ` upon success.
720
+
721
+ Asynchronously copies the entire directory structure from ` src` to ` dest` ,
722
+ including subdirectories and files.
723
+
724
+ When copying a directory to another directory, globs are not supported and
725
+ behavior is similar to ` cp dir1/ dir2/ ` .
726
+
696
727
### ` fsPromises .lchmod (path, mode)`
697
728
<!-- YAML
698
729
deprecated: v10.0.0
@@ -1800,6 +1831,37 @@ copyFile('source.txt', 'destination.txt', callback);
1800
1831
copyFile('source.txt', 'destination.txt', constants.COPYFILE_EXCL, callback);
1801
1832
```
1802
1833
1834
+ ### `fs.cp(src, dest[, options], callback)`
1835
+ <!-- YAML
1836
+ added: REPLACEME
1837
+ -->
1838
+
1839
+ > Stability: 1 - Experimental
1840
+
1841
+ * `src` {string|URL} source path to copy.
1842
+ * `dest` {string|URL} destination path to copy to.
1843
+ * `options` {Object}
1844
+ * `dereference` {boolean} dereference symlinks. **Default:** `false`.
1845
+ * `errorOnExist` {boolean} when `force` is `false`, and the destination
1846
+ exists, throw an error. **Default:** `false`.
1847
+ * `filter` {Function} Function to filter copied files/directories. Return
1848
+ `true` to copy the item, `false` to ignore it. Can also return a `Promise`
1849
+ that resolves to `true` or `false` **Default:** `undefined`.
1850
+ * `force` {boolean} overwrite existing file or directory. _The copy
1851
+ operation will ignore errors if you set this to false and the destination
1852
+ exists. Use the `errorOnExist` option to change this behavior.
1853
+ **Default:** `true`.
1854
+ * `preserveTimestamps` {boolean} When `true` timestamps from `src` will
1855
+ be preserved. **Default:** `false`.
1856
+ * `recursive` {boolean} copy directories recursively **Default:** `false`
1857
+ * `callback` {Function}
1858
+
1859
+ Asynchronously copies the entire directory structure from `src` to `dest`,
1860
+ including subdirectories and files.
1861
+
1862
+ When copying a directory to another directory, globs are not supported and
1863
+ behavior is similar to `cp dir1/ dir2/`.
1864
+
1803
1865
### `fs.createReadStream(path[, options])`
1804
1866
<!-- YAML
1805
1867
added: v0.1.31
@@ -4267,6 +4329,35 @@ console.log('source.txt was copied to destination.txt');
4267
4329
copyFileSync (' source.txt' , ' destination.txt' , constants .COPYFILE_EXCL );
4268
4330
` ` `
4269
4331
4332
+ ### ` fs .cpSync (src, dest[, options])`
4333
+ <!-- YAML
4334
+ added: REPLACEME
4335
+ -->
4336
+
4337
+ > Stability: 1 - Experimental
4338
+
4339
+ * ` src` {string|URL} source path to copy.
4340
+ * ` dest` {string|URL} destination path to copy to.
4341
+ * ` options` {Object}
4342
+ * ` dereference` {boolean} dereference symlinks. **Default:** ` false ` .
4343
+ * ` errorOnExist` {boolean} when ` force` is ` false ` , and the destination
4344
+ exists, throw an error. **Default:** ` false ` .
4345
+ * ` filter` {Function} Function to filter copied files/directories. Return
4346
+ ` true ` to copy the item, ` false ` to ignore it. **Default:** ` undefined `
4347
+ * ` force` {boolean} overwrite existing file or directory. _The copy
4348
+ operation will ignore errors if you set this to false and the destination
4349
+ exists. Use the ` errorOnExist` option to change this behavior.
4350
+ **Default:** ` true ` .
4351
+ * ` preserveTimestamps` {boolean} When ` true ` timestamps from ` src` will
4352
+ be preserved. **Default:** ` false ` .
4353
+ * ` recursive` {boolean} copy directories recursively **Default:** ` false `
4354
+
4355
+ Synchronously copies the entire directory structure from ` src` to ` dest` ,
4356
+ including subdirectories and files.
4357
+
4358
+ When copying a directory to another directory, globs are not supported and
4359
+ behavior is similar to ` cp dir1/ dir2/ ` .
4360
+
4270
4361
### ` fs .existsSync (path)`
4271
4362
<!-- YAML
4272
4363
added: v0.1.21
0 commit comments