Update fs.md by muzhaqi16 · Pull Request #35726 · nodejs/node

@muzhaqi16

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

@muzhaqi16

@nodejs-github-bot nodejs-github-bot added doc

Issues and PRs related to the documentations.

fs

Issues and PRs related to the fs subsystem / file system.

labels

Oct 21, 2020

@codecov-io

@Trott

Welcome @muzhaqi16, and thanks for the pull request.

require('fs/promises') and require('fs').promises are equivalent. I'm going to close this, but if you think the change should be made, please explain in a comment and we can reopen it.

@muzhaqi16

I thought it was the same thing as well but unfortunately when I use require('fs/promises') I do receive an error message on my node environment but not if I use the second option.

Error: Cannot find module 'fs/promises'
Require stack:

My node version is v12.18.3