* Opens a directory asynchronously. * @param {string} dirPath The directory path * @param {object|Function} [options] Options or callback * @param {Function} [callback] Callback (err, dir)
(dirPath, options, callback)
| 974 | * @param {Function} [callback] Callback (err, dir) |
| 975 | */ |
| 976 | opendir(dirPath, options, callback) { |
| 977 | if (typeof options === 'function') { |
| 978 | callback = options; |
| 979 | options = undefined; |
| 980 | } |
| 981 | try { |
| 982 | const dir = this.opendirSync(dirPath, options); |
| 983 | process.nextTick(callback, null, dir); |
| 984 | } catch (err) { |
| 985 | process.nextTick(callback, err); |
| 986 | } |
| 987 | } |
| 988 | |
| 989 | // ==================== Stream Operations ==================== |
| 990 |