Skip to content

Commit 9b43af3

Browse files
jasnellMylesBorins
authored andcommitted
fs: lazy load createPromise/promiseResolve
PR-URL: #20766 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Minwoo Jung <[email protected]> Reviewed-By: Tiancheng "Timothy" Gu <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
1 parent 2d28978 commit 9b43af3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/fs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ const {
4444
const util = require('util');
4545
const pathModule = require('path');
4646
const { isUint8Array } = require('internal/util/types');
47-
const { createPromise, promiseResolve } = process.binding('util');
4847

4948
const binding = process.binding('fs');
5049
const fs = exports;
@@ -248,6 +247,7 @@ fs.exists = function(path, callback) {
248247

249248
Object.defineProperty(fs.exists, internalUtil.promisify.custom, {
250249
value: (path) => {
250+
const { createPromise, promiseResolve } = process.binding('util');
251251
const promise = createPromise();
252252
fs.exists(path, (exists) => promiseResolve(promise, exists));
253253
return promise;

0 commit comments

Comments
 (0)