MCPcopy Index your code
hub / github.com/nodejs/node / constructor

Method constructor

lib/internal/fs/dir.js:52–75  ·  view source on GitHub ↗
(handle, path, options)

Source from the content-addressed store, hash-verified

50 #handlerQueue = [];
51
52 constructor(handle, path, options) {
53 if (handle == null) throw new ERR_MISSING_ARGS('handle');
54 this.#handle = handle;
55 this.#path = path;
56 this.#options = {
57 bufferSize: 32,
58 ...getOptions(options, {
59 encoding: 'utf8',
60 }),
61 };
62
63 try {
64 validateUint32(this.#options.bufferSize, 'options.bufferSize', true);
65 } catch (validationError) {
66 // Userland won't be able to close handle if we throw, so we close it first
67 this.#handle.close();
68 throw validationError;
69 }
70
71 this.#readPromisified = FunctionPrototypeBind(
72 promisify(this.#readImpl), this, false);
73 this.#closePromisified = FunctionPrototypeBind(
74 promisify(this.close), this);
75 }
76
77 get path() {
78 if (!(#path in this))

Callers

nothing calls this directly

Calls 3

promisifyFunction · 0.85
getOptionsFunction · 0.70
closeMethod · 0.65

Tested by

no test coverage detected