Skip to content

Commit

Permalink
Update writing-files-with-nodejs.md (#6255)
Browse files Browse the repository at this point in the history
Minor changes to reflect purpose of examples

Signed-off-by: Davide Morra <[email protected]>
  • Loading branch information
mrddter authored Jan 20, 2024
1 parent 21ee6cf commit a48098a
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ const content = 'Some content!';
fs.writeFile('/Users/joe/test.txt', content, err => {
if (err) {
console.error(err);
} else {
// file written successfully
}
// file written successfully
});
```

Expand Down Expand Up @@ -53,6 +54,7 @@ async function example() {
console.log(err);
}
}

example();
```

Expand Down Expand Up @@ -91,8 +93,9 @@ const content = 'Some content!';
fs.appendFile('file.log', content, err => {
if (err) {
console.error(err);
} else {
// done!
}
// done!
});
```

Expand All @@ -111,5 +114,6 @@ async function example() {
console.log(err);
}
}

example();
```

0 comments on commit a48098a

Please sign in to comment.