Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
fixup
  • Loading branch information
jakecastelli committed Mar 5, 2023
1 parent 7ba5500 commit 67da4a3
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions doc/api/fs.md
Original file line number Diff line number Diff line change
Expand Up @@ -7564,12 +7564,12 @@ 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);
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 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 67da4a3

Please sign in to comment.