From b8e41774d4287d128a40f7ecfecf170fe16fe9ed Mon Sep 17 00:00:00 2001 From: Gus Caplan Date: Tue, 28 Jan 2020 08:29:29 -0800 Subject: [PATCH] fs: add fs/promises alias module MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/31553 Reviewed-By: Matteo Collina Reviewed-By: Luigi Pinca Reviewed-By: Colin Ihrig Reviewed-By: Myles Borins Reviewed-By: Rich Trott Reviewed-By: James M Snell Reviewed-By: Tobias Nießen Reviewed-By: Yuta Hiroto --- doc/api/fs.md | 2 +- lib/fs/promises.js | 3 +++ node.gyp | 1 + test/es-module/test-esm-fs-promises.mjs | 5 +++++ test/parallel/test-fs-promises-exists.js | 6 ++++++ 5 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 lib/fs/promises.js create mode 100644 test/es-module/test-esm-fs-promises.mjs create mode 100644 test/parallel/test-fs-promises-exists.js diff --git a/doc/api/fs.md b/doc/api/fs.md index bb32e27fbf2430..7c5c3677868c6a 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -4237,7 +4237,7 @@ this API: [`fs.writev()`][]. The `fs.promises` API provides an alternative set of asynchronous file system methods that return `Promise` objects rather than using callbacks. The -API is accessible via `require('fs').promises`. +API is accessible via `require('fs').promises` or `require('fs/promises')`. ### class: `FileHandle`