Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
jakecastelli committed Mar 5, 2023
1 parent 7ba5500 commit a46a1f6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions doc/api/fs.md
Original file line number Diff line number Diff line change
Expand Up @@ -7564,11 +7564,11 @@ of one before invoking the other:
```mjs
import { rename, stat } from 'node:fs/promises';
const fromDir = '/tmp/hello';
const toDir = '/tmp/world';
const oldPath = '/tmp/hello';
const newPath = '/tmp/world';
try {
await rename(fromDir, toDir);
await rename(oldPath, newPath);
const stats = await stat(toDir);
console.log(`stats: ${JSON.stringify(stats)}`);
} catch (error) {
Expand All @@ -7579,10 +7579,10 @@ try {
```cjs
const { rename, stat } = require('node:fs/promises');
(async function(fromDir, toDir) {
(async function(oldPath, newPath) {
try {
await rename(fromDir, toDir);
const stats = await stat(toDir);
await rename(oldPath, newPath);
const stats = await stat(newPath);
console.log(`stats: ${JSON.stringify(stats)}`);
} catch (error) {
console.error('there was an error:', error.message);
Expand Down

0 comments on commit a46a1f6

Please sign in to comment.