You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Activity
aduh95 commentedon Oct 21, 2020
The current documentation is only true for Node.js 14+. For Node.js 12, please check out https://nodejs.org/docs/latest-v12.x/api/fs.html#fs_fs_promises_api
For info, here is the support table for those features:
require('fs/promises')require('fs').promisesMaybe we could add an history section in the docs to clarify what support users can expect.
doc: add history section for fs Promises API
doc: update fs promise-based examples
doc: update fs promise-based examples
doc: document changes for `*/promises` alias modules
doc: document changes for `*/promises` alias modules
polyfill readFile promise
doc: document changes for `*/promises` alias modules