Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
doc: apply review to doc addition for fs.stat()
Envelope folder structure between backticks.
Make the example program comply with
strict mode.
  • Loading branch information
fev4 committed Jun 22, 2019
commit e8ada7c6236ace4524f833c23f4d76ab837e4f12
10 changes: 6 additions & 4 deletions doc/api/fs.md
Original file line number Diff line number Diff line change
Expand Up @@ -3079,9 +3079,11 @@ is recommended.

For example, given the following folder structure:

-txtDir
--file.txt
-app.js
```fundamental
- txtDir
-- file.txt
- app.js
```

The next program will check for the stats of the given paths:

Expand All @@ -3090,7 +3092,7 @@ const fs = require('fs');

const pathsToCheck = ['./txtDir', './txtDir/file.txt'];

for (i = 0; i < pathsToCheck.length; i++) {
for (let i = 0; i < pathsToCheck.length; i++) {
fs.stat(pathsToCheck[i], function(err, stats) {
console.log(stats.isDirectory());
console.log(stats);
Expand Down