Skip to content

Commit 32e0854

Browse files
authored
fix(fs-extra): add missing recursive opt to cp (#194)
1 parent ea8b45f commit 32e0854

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

docs/modules/fs-extra.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,17 @@ import * as fs from 'node:fs';
2525

2626
#### Equivalent Methods
2727

28-
| fs-extra | node:fs | Notes |
29-
| ------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
30-
| `copySync(src, dest[, options])` | `fs.copyFileSync(src, dest[, mode])` | |
31-
| `mkdirs(dir[,options][,callback])`, `mkdirp(dir[,options][,callback])`, `ensureDir(dir[,options][,callback])` | `fs.mkdir(dir, { recursive: true }, callback)` | `ensureDir` and `mkdirp` are aliases of `mkdirs` |
32-
| `mkdirpSync(dir[,options])`, `mkdirsSync(dir[,options])`, `ensureDirSync(dir[,options])` | `fs.mkdirSync(dir, { recursive: true })` | `ensureDirSync` and `mkdirpSync` are aliases of `mkdirsSync` |
33-
| `remove(path[,callback])` | `fs.rm(path, { recursive: true, force: true }, callback)` | |
34-
| `removeSync(dir)` | `fs.rmSync(dir, { recursive: true, force: true })` | |
35-
| `move(src, dest, { overwrite: true }, callback)` | `fs.rename(source, destination)` | |
36-
| `moveSync(source, destination, { overwrite: true })` | `fs.renameSync(source, destination)` | These are not strictly equivalent. The `move` methods in fs-extra act like the `mv` command and they will work across devices also. The `rename` methods in fs work like the `rename` system call and will **not** work across devices. Having Node’s `rename` methods work across devices is currently [marked as a "won't fix."](https://github.com/nodejs/node/issues/19077) Also, the `overwrite: true` behaviour is the default/only behaviour in the standard library. |
37-
| `copy(source, destination, callback)` | `fs.cp(source, destination, callback)` | |
38-
| `pathExistsSync(file)` | `fs.existsSync(path)` | |
28+
| fs-extra | node:fs | Notes |
29+
| ------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
30+
| `copySync(src, dest[, options])` | `fs.copyFileSync(src, dest[, mode])` | |
31+
| `mkdirs(dir[,options][,callback])`, `mkdirp(dir[,options][,callback])`, `ensureDir(dir[,options][,callback])` | `fs.mkdir(dir, { recursive: true }, callback)` | `ensureDir` and `mkdirp` are aliases of `mkdirs` |
32+
| `mkdirpSync(dir[,options])`, `mkdirsSync(dir[,options])`, `ensureDirSync(dir[,options])` | `fs.mkdirSync(dir, { recursive: true })` | `ensureDirSync` and `mkdirpSync` are aliases of `mkdirsSync` |
33+
| `remove(path[,callback])` | `fs.rm(path, { recursive: true, force: true }, callback)` | |
34+
| `removeSync(dir)` | `fs.rmSync(dir, { recursive: true, force: true })` | |
35+
| `move(src, dest, { overwrite: true }, callback)` | `fs.rename(source, destination)` | |
36+
| `moveSync(source, destination, { overwrite: true })` | `fs.renameSync(source, destination)` | These are not strictly equivalent. The `move` methods in fs-extra act like the `mv` command and they will work across devices also. The `rename` methods in fs work like the `rename` system call and will **not** work across devices. Having Node’s `rename` methods work across devices is currently [marked as a "won't fix."](https://github.com/nodejs/node/issues/19077) Also, the `overwrite: true` behaviour is the default/only behaviour in the standard library. |
37+
| `copy(source, destination, callback)` | `fs.cp(source, destination, { recursive: true}, callback)` | |
38+
| `pathExistsSync(file)` | `fs.existsSync(path)` | |
3939

4040
#### Methods that need migrating or more than one `node:fs` method
4141

0 commit comments

Comments
 (0)