Update fs.md by muzhaqi16 · Pull Request #35726 · nodejs/node
Checklist
-
make -j4 test(UNIX), orvcbuild test(Windows) passes - tests and/or benchmarks are included
- documentation is changed or added
- commit message follows commit guidelines
nodejs-github-bot
added
doc
labels
Oct 21, 2020Welcome @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.
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters