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

Function processDirCb

test/sequential/test-fs-opendir-recursive.js:173–192  ·  view source on GitHub ↗
(dir, cb)

Source from the content-addressed store, hash-verified

171// Opendir read result using callback
172
173function processDirCb(dir, cb) {
174 const acc = [];
175
176 function _process(dir, acc, cb) {
177 dir.read((err, dirent) => {
178 if (err) {
179 return cb(err);
180 }
181
182 if (dirent !== null) {
183 acc.push(dirent);
184 _process(dir, acc, cb);
185 } else {
186 cb(null, acc);
187 }
188 });
189 }
190
191 _process(dir, acc, cb);
192}
193
194{
195 const dir = fs.opendirSync(testDir, { recursive: true });

Callers 1

Calls 1

_processFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…