We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5583547 commit d411d1dCopy full SHA for d411d1d
doc/api/fs.md
@@ -2529,8 +2529,19 @@ changes:
2529
* `callback` {Function}
2530
* `err` {Error}
2531
2532
-Asynchronous rename(2). No arguments other than a possible exception are given
2533
-to the completion callback.
+Asynchronously rename file at `oldPath` to the pathname provided
+as `newPath`. In the case that `newPath` already exists, it will
2534
+be overwritten. No arguments other than a possible exception are
2535
+given to the completion callback.
2536
+
2537
+See also: rename(2).
2538
2539
+```js
2540
+fs.rename('oldFile.txt', 'newFile.txt', (err) => {
2541
+ if (err) throw err;
2542
+ console.log('Rename complete!');
2543
+});
2544
+```
2545
2546
## fs.renameSync(oldPath, newPath)
2547
<!-- YAML
0 commit comments