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

Method readdir

lib/internal/vfs/file_system.js:714–722  ·  view source on GitHub ↗

* Reads directory contents asynchronously. * @param {string} dirPath The directory path * @param {object|Function} [options] Options or callback * @param {Function} [callback] Callback (err, entries)

(dirPath, options, callback)

Source from the content-addressed store, hash-verified

712 * @param {Function} [callback] Callback (err, entries)
713 */
714 readdir(dirPath, options, callback) {
715 if (typeof options === 'function') {
716 callback = options;
717 options = undefined;
718 }
719
720 this[kProvider].readdir(this.#toProviderPath(dirPath), options)
721 .then((entries) => callback(null, entries), (err) => callback(err));
722 }
723
724 /**
725 * Gets the real path asynchronously.

Callers 1

rmMethod · 0.45

Calls 3

#toProviderPathMethod · 0.95
callbackFunction · 0.50
thenMethod · 0.45

Tested by

no test coverage detected