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 d9895c4 commit e2190adCopy full SHA for e2190ad
doc/api/fs.md
@@ -2238,8 +2238,19 @@ changes:
2238
* `callback` {Function}
2239
* `err` {Error}
2240
2241
-Asynchronous rename(2). No arguments other than a possible exception are given
2242
-to the completion callback.
+Asynchronously rename file at `oldPath` to the pathname provided
+as `newPath`. In the case that `newPath` already exists, it will
2243
+be overwritten. No arguments other than a possible exception are
2244
+given to the completion callback.
2245
+
2246
+See also: rename(2).
2247
2248
+```js
2249
+fs.rename('oldFile.txt', 'newFile.txt', (err) => {
2250
+ if (err) throw err;
2251
+ console.log('Rename complete!');
2252
+});
2253
+```
2254
2255
## fs.renameSync(oldPath, newPath)
2256
<!-- YAML
0 commit comments